From b650fc2e7a824b63292ce8da57927d136db3df14 Mon Sep 17 00:00:00 2001 From: Dimitri Bouniol Date: Wed, 9 Oct 2024 06:10:23 -0700 Subject: [PATCH] Refactored old swift syntax --- .../Disk Persistence/Snapshot/Snapshot.swift | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Sources/CodableDatastore/Persistence/Disk Persistence/Snapshot/Snapshot.swift b/Sources/CodableDatastore/Persistence/Disk Persistence/Snapshot/Snapshot.swift index f7f2c64..15e15dd 100644 --- a/Sources/CodableDatastore/Persistence/Disk Persistence/Snapshot/Snapshot.swift +++ b/Sources/CodableDatastore/Persistence/Disk Persistence/Snapshot/Snapshot.swift @@ -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.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)