mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Replace forEach for for-in.
This commit is contained in:
@@ -65,7 +65,9 @@ public protocol MainThreadOperationDelegate: AnyObject {
|
||||
/// Add multiple operations to the queue.
|
||||
/// This has the same effect as calling addOperation one-by-one.
|
||||
@MainActor public func addOperations(_ operations: [MainThreadOperation]) {
|
||||
operations.forEach{ add($0) }
|
||||
for operation in operations {
|
||||
add(operation)
|
||||
}
|
||||
}
|
||||
|
||||
/// Add a dependency. Do this *before* calling addOperation, since addOperation might run the operation right away.
|
||||
@@ -450,16 +452,22 @@ private extension MainThreadOperationDependencies {
|
||||
}
|
||||
|
||||
func removeDependencies(_ parentOperationIDs: [Int]) {
|
||||
parentOperationIDs.forEach { dependencies[$0] = nil }
|
||||
for parentOperationID in parentOperationIDs {
|
||||
dependencies[parentOperationID] = nil
|
||||
}
|
||||
}
|
||||
|
||||
func removeChildOperationIDs(_ operationIDs: [Int]) {
|
||||
operationIDs.forEach{ removeChildOperationID($0) }
|
||||
for operationID in operationIDs {
|
||||
removeChildOperationID(operationID)
|
||||
}
|
||||
removeEmptyDependencies()
|
||||
}
|
||||
|
||||
func removeChildOperationID(_ operationID: Int) {
|
||||
dependencies.values.forEach{ $0.remove(operationID) }
|
||||
for dependency in dependencies.values {
|
||||
dependency.remove(operationID)
|
||||
}
|
||||
}
|
||||
|
||||
func removeEmptyDependencies() {
|
||||
|
||||
Reference in New Issue
Block a user