Use resultSet.compactMap.

This commit is contained in:
Brent Simmons committed 2026-03-13 08:52:25 -07:00
1 parent f3ea3e496a
commit 8cf466028a
1 file changed
+1 -8
@@ -32,14 +32,7 @@ struct ErrorLogTable {
guard let resultSet = database.executeQuery(sql, withArgumentsIn: nil) else {
return []
}
var entries = [ErrorLogEntry]()
while resultSet.next() {
if let entry = entryWithRow(resultSet) {
entries.append(entry)
}
}
return entries
return resultSet.compactMap(entryWithRow)
}
static func pruneEntries(limit: Int, database: FMDatabase) {