Skip to content

Commit

Permalink
#154 Fix UUID Embedded Swift support
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Nov 4, 2024
1 parent 1178722 commit 116db3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Bluetooth/Extensions/UUID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public struct UUID: Sendable {
}
}

internal typealias _UUID = Bluetooth.UUID // Built-in UUID type
public typealias _UUID = Bluetooth.UUID // Built-in UUID type

#endif

Expand Down Expand Up @@ -213,7 +213,7 @@ extension _UUID : Comparable {
var diff: Int = 0
withUnsafeBytes(of: &leftUUID) { leftPtr in
withUnsafeBytes(of: &rightUUID) { rightPtr in
for offset in (0 ..< MemoryLayout<uuid_t>.size).reversed() {
for offset in (0 ..< MemoryLayout<ByteValue>.size).reversed() {
diff = Int(leftPtr.load(fromByteOffset: offset, as: UInt8.self)) -
Int(rightPtr.load(fromByteOffset: offset, as: UInt8.self))
// Constant time, no branching equivalent of
Expand Down

0 comments on commit 116db3b

Please sign in to comment.