Rename count(where:) to countElements(where:)

This commit is contained in:
Gwendal Roué committed 2020-04-09 17:47:07 +02:00
1 parent 8ef4c9b241
commit 078aa83e3b
2 files changed
+4 -2

No files matched your search

@@ -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)
+1 -1
View File
@@ -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