Skip to content

Commit 141f629

Browse files
committed
Simplify expression ID unpacking (const-hoist)
1 parent 551a699 commit 141f629

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Testing/SourceAttribution/ExpressionID.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public struct __ExpressionID: Sendable {
4242
return nybbles
4343
.enumerated()
4444
.flatMap { i, nybble in
45-
(0 ..< Self._bitsPerNybble).lazy
45+
let nybbleOffset = i * Self._bitsPerNybble
46+
return (0 ..< Self._bitsPerNybble).lazy
4647
.filter { (nybble & (1 << $0)) != 0 }
47-
.map { (i * Self._bitsPerNybble) + $0 }
48-
.map(UInt32.init)
48+
.map { UInt32(nybbleOffset + $0) }
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)