From 8cf466028ade2566c173de291cea966716f062bc Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 13 Mar 2026 08:52:25 -0700 Subject: [PATCH] Use resultSet.compactMap. --- Modules/ErrorLog/Sources/ErrorLog/ErrorLogTable.swift | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Modules/ErrorLog/Sources/ErrorLog/ErrorLogTable.swift b/Modules/ErrorLog/Sources/ErrorLog/ErrorLogTable.swift index f08d59c95..3488c0cc2 100644 --- a/Modules/ErrorLog/Sources/ErrorLog/ErrorLogTable.swift +++ b/Modules/ErrorLog/Sources/ErrorLog/ErrorLogTable.swift @@ -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) {