File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ extension StaticBigInt: CustomDebugStringConvertible {
148
148
var result = String ( unsafeUninitializedCapacity: capacity) { utf8 in
149
149
150
150
// Pre-initialize with zeros, ignoring extra capacity.
151
- var utf8 = UnsafeMutableBufferPointer ( rebasing : utf8. prefix ( capacity) )
151
+ var utf8 = utf8. prefix ( capacity)
152
152
utf8. initialize ( repeating: UInt8 ( ascii: " 0 " ) )
153
153
154
154
// Use a 32-bit element type, to generate small hexadecimal strings.
@@ -171,12 +171,8 @@ extension StaticBigInt: CustomDebugStringConvertible {
171
171
172
172
// Overwrite trailing zeros with hexadecimal digits.
173
173
let hexDigits = String ( element, radix: 16 , uppercase: true ) . utf8
174
- _ = UnsafeMutableBufferPointer (
175
- rebasing: utf8. suffix ( hexDigits. count)
176
- ) . initialize ( from: hexDigits)
177
- utf8 = UnsafeMutableBufferPointer (
178
- rebasing: utf8. dropLast ( hexDigitsPerElement)
179
- )
174
+ _ = utf8. suffix ( hexDigits. count) . update ( fromContentsOf: hexDigits)
175
+ utf8 = utf8. dropLast ( hexDigitsPerElement)
180
176
}
181
177
return capacity
182
178
}
You can’t perform that action at this time.
0 commit comments