Skip to content

Commit

Permalink
Refactored old swift syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitribouniol committed Oct 9, 2024
1 parent 15db473 commit 4ad5a0e
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,11 @@ private enum SnapshotTaskLocals {
extension Snapshot {
/// Load the datastore for the given key.
func loadDatastore(for key: DatastoreKey, from iteration: SnapshotIteration) -> (DiskPersistence<AccessMode>.Datastore, DatastoreRootIdentifier?) {
let datastoreInfo: (id: DatastoreIdentifier, root: DatastoreRootIdentifier?) = {
if let info = iteration.dataStores[key] {
return (info.id, info.root)
} else {
return (DatastoreIdentifier(name: key.rawValue), nil)
}
}()
let datastoreInfo = if let info = iteration.dataStores[key] {
(id: info.id, root: info.root)
} else {
(id: DatastoreIdentifier(name: key.rawValue), root: DatastoreRootIdentifier?.none)
}

if let datastore = datastores[datastoreInfo.id] {
return (datastore, datastoreInfo.root)
Expand Down

0 comments on commit 4ad5a0e

Please sign in to comment.