File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -313,17 +313,7 @@ extension _SmallString {
313
313
) rethrows {
314
314
self . init ( )
315
315
try self . withMutableCapacity {
316
- let capacity = $0. count
317
- let rawPtr = $0. baseAddress. _unsafelyUnwrappedUnchecked
318
- // Rebind the underlying (UInt64, UInt64) tuple to UInt8 for the
319
- // duration of the closure. Accessing self after this rebind is undefined.
320
- let ptr = rawPtr. bindMemory ( to: UInt8 . self, capacity: capacity)
321
- defer {
322
- // Restore the memory type of self._storage
323
- _ = rawPtr. bindMemory ( to: RawBitPattern . self, capacity: 1 )
324
- }
325
- return try initializer (
326
- UnsafeMutableBufferPointer < UInt8 > ( start: ptr, count: capacity) )
316
+ try $0. withMemoryRebound ( to: UInt8 . self, initializer)
327
317
}
328
318
self . _invariantCheck ( )
329
319
}
You can’t perform that action at this time.
0 commit comments