Skip to content

Commit 7d0b437

Browse files
committed
Replace UUID with class
1 parent bb0b011 commit 7d0b437

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Sources/IdentifiableContinuation.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,17 @@ public struct IdentifiableContinuation<T, E>: Sendable, Identifiable where E : E
191191

192192
public let id: ID
193193

194-
public struct ID: Hashable, Sendable {
195-
private let uuid: UUID
194+
public final class ID: Hashable, Sendable {
196195

197196
@usableFromInline
198-
init() {
199-
self.uuid = UUID()
197+
init() { }
198+
199+
public func hash(into hasher: inout Hasher) {
200+
ObjectIdentifier(self).hash(into: &hasher)
201+
}
202+
203+
public static func == (lhs: IdentifiableContinuation<T, E>.ID, rhs: IdentifiableContinuation<T, E>.ID) -> Bool {
204+
lhs === rhs
200205
}
201206
}
202207

0 commit comments

Comments
 (0)