We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a519ef6 commit c385cbeCopy full SHA for c385cbe
Sources/Differentiator/Diff.swift
@@ -129,13 +129,15 @@ public enum Diff {
129
private struct OptimizedIdentity<E: Hashable> : Hashable {
130
131
let identity: UnsafePointer<E>
132
+ private let cachedHashValue: Int
133
134
init(_ identity: UnsafePointer<E>) {
135
self.identity = identity
136
+ self.cachedHashValue = identity.pointee.hashValue
137
}
138
139
func hash(into hasher: inout Hasher) {
- hasher.combine(self.identity.pointee.hashValue)
140
+ hasher.combine(self.cachedHashValue)
141
142
143
static func == (lhs: OptimizedIdentity<E>, rhs: OptimizedIdentity<E>) -> Bool {
0 commit comments