@@ -192,7 +192,7 @@ extension Datastore {
192192
193193 /// Check existing direct indexes for compatibility
194194 for (_, persistedIndex) in persistedDescriptor. directIndexes {
195- if let updatedIndex = updatedDescriptor. directIndexes [ persistedIndex. name. rawValue ] {
195+ if let updatedIndex = updatedDescriptor. directIndexes [ persistedIndex. name] {
196196 /// If the index still exists, make sure it is compatible by checking their types, or checking if the primary index must be re-built.
197197 if persistedIndex. type != updatedIndex. type || rebuildPrimaryIndex {
198198 /// They were not compatible, so delete the bad index, and queue it to be re-built.
@@ -207,14 +207,14 @@ extension Datastore {
207207
208208 /// Check for new direct indexes to build
209209 for (_, updatedIndex) in updatedDescriptor. directIndexes {
210- guard persistedDescriptor. directIndexes [ updatedIndex. name. rawValue ] == nil else { continue }
210+ guard persistedDescriptor. directIndexes [ updatedIndex. name] == nil else { continue }
211211 /// The index does not yet exist, so queue it to be built.
212212 directIndexesToBuild. insert ( updatedIndex. name)
213213 }
214214
215215 /// Check existing secondary indexes for compatibility
216216 for (_, persistedIndex) in persistedDescriptor. secondaryIndexes {
217- if let updatedIndex = updatedDescriptor. secondaryIndexes [ persistedIndex. name. rawValue ] {
217+ if let updatedIndex = updatedDescriptor. secondaryIndexes [ persistedIndex. name] {
218218 /// If the index still exists, make sure it is compatible
219219 if persistedIndex. type != updatedIndex. type {
220220 /// They were not compatible, so delete the bad index, and queue it to be re-built.
@@ -229,7 +229,7 @@ extension Datastore {
229229
230230 /// Check for new secondary indexes to build
231231 for (_, updatedIndex) in updatedDescriptor. secondaryIndexes {
232- guard persistedDescriptor. secondaryIndexes [ updatedIndex. name. rawValue ] == nil else { continue }
232+ guard persistedDescriptor. secondaryIndexes [ updatedIndex. name] == nil else { continue }
233233 /// The index does not yet exist, so queue it to be built.
234234 secondaryIndexesToBuild. insert ( updatedIndex. name)
235235 }
@@ -384,7 +384,7 @@ extension Datastore where AccessMode == ReadWrite {
384384 let descriptor = try await transaction. datastoreDescriptor ( for: self . key) ,
385385 descriptor. size > 0 ,
386386 /// If we don't have an index stored, there is nothing to do here. This means we can skip checking it on the type.
387- let matchingIndex = descriptor. directIndexes [ index. path. rawValue ] ?? descriptor. secondaryIndexes [ index. path. rawValue ] ,
387+ let matchingIndex = descriptor. directIndexes [ index. path] ?? descriptor. secondaryIndexes [ index. path] ,
388388 /// We don't care in this method of the version is incompatible — the index will be discarded.
389389 let version = try ? Version ( matchingIndex. version) ,
390390 /// Make sure the stored version is smaller than the one we require, otherwise stop early.
@@ -403,7 +403,7 @@ extension Datastore where AccessMode == ReadWrite {
403403 let descriptor = try await transaction. datastoreDescriptor ( for: self . key) ,
404404 descriptor. size > 0 ,
405405 /// If we don't have an index stored, there is nothing to do here. This means we can skip checking it on the type.
406- let matchingIndex = descriptor. directIndexes [ index. path. rawValue ] ?? descriptor. secondaryIndexes [ index. path. rawValue ] ,
406+ let matchingIndex = descriptor. directIndexes [ index. path] ?? descriptor. secondaryIndexes [ index. path] ,
407407 /// We don't care in this method of the version is incompatible — the index will be discarded.
408408 let version = try ? Version ( matchingIndex. version) ,
409409 /// Make sure the stored version is smaller than the one we require, otherwise stop early.
0 commit comments