mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
Cleanup
This commit is contained in:
1 parent
b82f92f726
commit
4e65425c00
2 files changed
+6
-6
No files matched your search
@@ -639,7 +639,7 @@ struct StatementCache {
|
||||
statements.removeFirst { $0.value === statement }
|
||||
}
|
||||
|
||||
mutating func clear(where isDeleted: (Statement) -> Bool) {
|
||||
statements = statements.filter { (_, statement) in !isDeleted(statement) }
|
||||
mutating func removeAll(where shouldBeRemoved: (Statement) -> Bool) {
|
||||
statements = statements.filter { (_, statement) in !shouldBeRemoved(statement) }
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,8 @@ extension Database {
|
||||
|
||||
// Drop cached statements that delete, this the addition of an
|
||||
// observer may change the need for truncate optimization prevention.
|
||||
publicStatementCache.clear(where: { $0.databaseEventKinds.contains(where: \.isDelete) })
|
||||
internalStatementCache.clear(where: { $0.databaseEventKinds.contains(where: \.isDelete) })
|
||||
publicStatementCache.removeAll { $0.databaseEventKinds.contains(where: \.isDelete) }
|
||||
internalStatementCache.removeAll{ $0.databaseEventKinds.contains(where: \.isDelete) }
|
||||
|
||||
observationBroker.add(transactionObserver: transactionObserver, extent: extent)
|
||||
}
|
||||
@@ -29,8 +29,8 @@ extension Database {
|
||||
|
||||
// Drop cached statements that delete, this the removal of an
|
||||
// observer may change the need for truncate optimization prevention.
|
||||
publicStatementCache.clear(where: { $0.databaseEventKinds.contains(where: \.isDelete) })
|
||||
internalStatementCache.clear(where: { $0.databaseEventKinds.contains(where: \.isDelete) })
|
||||
publicStatementCache.removeAll { $0.databaseEventKinds.contains(where: \.isDelete) }
|
||||
internalStatementCache.removeAll { $0.databaseEventKinds.contains(where: \.isDelete) }
|
||||
|
||||
observationBroker.remove(transactionObserver: transactionObserver)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user