Skip to content

Commit 4ad5a0e

Browse files
Refactored old swift syntax
1 parent 15db473 commit 4ad5a0e

File tree

1 file changed

+5
-7
lines changed
  • Sources/CodableDatastore/Persistence/Disk Persistence/Snapshot

1 file changed

+5
-7
lines changed

Sources/CodableDatastore/Persistence/Disk Persistence/Snapshot/Snapshot.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,11 @@ private enum SnapshotTaskLocals {
321321
extension Snapshot {
322322
/// Load the datastore for the given key.
323323
func loadDatastore(for key: DatastoreKey, from iteration: SnapshotIteration) -> (DiskPersistence<AccessMode>.Datastore, DatastoreRootIdentifier?) {
324-
let datastoreInfo: (id: DatastoreIdentifier, root: DatastoreRootIdentifier?) = {
325-
if let info = iteration.dataStores[key] {
326-
return (info.id, info.root)
327-
} else {
328-
return (DatastoreIdentifier(name: key.rawValue), nil)
329-
}
330-
}()
324+
let datastoreInfo = if let info = iteration.dataStores[key] {
325+
(id: info.id, root: info.root)
326+
} else {
327+
(id: DatastoreIdentifier(name: key.rawValue), root: DatastoreRootIdentifier?.none)
328+
}
331329

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

0 commit comments

Comments
 (0)