Skip to content

Commit 0ca5c8d

Browse files
committed
Optimize the 32-bit path too
1 parent 1853c6f commit 0ca5c8d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Sources/Testing/SourceAttribution/Backtrace.swift

+2-6
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ public struct Backtrace: Sendable {
3737
/// The pointers in `addresses` are converted to instances of ``Address``. Any
3838
/// `nil` addresses are represented as `0`.
3939
public init(addresses: some Sequence<UnsafeRawPointer?>) {
40-
self.init(
41-
addresses: addresses.lazy
42-
.map(UInt.init(bitPattern:))
43-
.map(Address.init)
44-
)
40+
self.addresses = addresses.map { Address(UInt(bitPattern: $0)) }
4541
}
4642

4743
/// Get the current backtrace.
@@ -93,7 +89,7 @@ public struct Backtrace: Sendable {
9389
}
9490
#else
9591
return addresses[..<endIndex].withMemoryRebound(to: UnsafeRawPointer?.self) { addresses in
96-
return Self(addresses: addresses)
92+
Self(addresses: addresses)
9793
}
9894
#endif
9995
}

0 commit comments

Comments
 (0)