Skip to content

Commit b9d6a63

Browse files
authored
Fix: Multiple .permanent instances keys are different when instantiated from different places. (#6)
#5
1 parent 76e5d0d commit b9d6a63

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Sources/DefaultValues.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,14 @@ public final class DefaultValues {
9898
let dependencyKey: DependencyKey?
9999

100100
func hash(into hasher: inout Hasher) {
101-
hasher.combine(ObjectIdentifier(storageKeyPath))
101+
hasher.combine(storageKeyPath)
102102
if let dependencyKey {
103103
hasher.combine(dependencyKey)
104104
}
105105
}
106106

107-
typealias ID = ObjectIdentifier
108107
static func == (lhs: DefaultValues.StorageID, rhs: DefaultValues.StorageID) -> Bool {
109-
let equalIDs = ID(lhs.storageKeyPath) == ID(rhs.storageKeyPath)
108+
let equalIDs = lhs.storageKeyPath == rhs.storageKeyPath
110109
switch (lhs.dependencyKey, rhs.dependencyKey) {
111110
case (.none, .none): return equalIDs
112111
case (.none, .some), (.some, .none): return false

0 commit comments

Comments
 (0)