From 2bd9bdbf27396e77775ec1d6caeeb3d0b98ecbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 17 Dec 2015 10:21:24 +0100 Subject: [PATCH] Faster Row.count --- GRDB/Core/Row.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GRDB/Core/Row.swift b/GRDB/Core/Row.swift index 5f58d41a9..a5db0a01f 100644 --- a/GRDB/Core/Row.swift +++ b/GRDB/Core/Row.swift @@ -409,9 +409,7 @@ public final class Row: CollectionType { // MARK: - Row as a Collection of (ColumnName, DatabaseValue) Pairs /// The number of columns in the row. - public var count: Int { - return impl.count - } + public lazy var count: Int = { self.impl.count }() /// The names of columns in the row. ///