From 078aa83e3bd4d39b4ce42e819c0eada9a6fa9d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 9 Apr 2020 17:47:07 +0200 Subject: [PATCH] Rename count(where:) to countElements(where:) --- GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift | 4 +++- GRDB/Utils/Utils.swift | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift b/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift index 0a8a30b4b..09714842b 100644 --- a/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift +++ b/GRDB/QueryInterface/SQLGeneration/SQLGenerationContext.swift @@ -310,7 +310,9 @@ extension Array where Element == TableAlias { for (lowercaseName, group) in groups { if group.count > 1 { // It is a programmer error to reuse the same alias for multiple tables - GRDBPrecondition(group.count(where: \.hasUserName) < 2, "ambiguous alias: \(group[0].identityName)") + GRDBPrecondition( + group.countElements(where: \.hasUserName) < 2, + "ambiguous alias: \(group[0].identityName)") ambiguousGroups.append(group) } else { uniqueLowercaseNames.insert(lowercaseName) diff --git a/GRDB/Utils/Utils.swift b/GRDB/Utils/Utils.swift index 962a810c5..383db5bc5 100644 --- a/GRDB/Utils/Utils.swift +++ b/GRDB/Utils/Utils.swift @@ -95,7 +95,7 @@ extension DispatchQueue { extension Sequence { @inlinable - func count(where predicate: (Element) throws -> Bool) rethrows -> Int { + func countElements(where predicate: (Element) throws -> Bool) rethrows -> Int { var count = 0 for e in self where try predicate(e) { count += 1