@@ -503,7 +503,9 @@ public struct ByteBuffer {
503
503
504
504
@inlinable
505
505
mutating func _setBytesAssumingUniqueBufferAccess( _ bytes: UnsafeRawBufferPointer , at index: _Index ) {
506
- let targetPtr = UnsafeMutableRawBufferPointer ( fastRebase: self . _slicedStorageBuffer. dropFirst ( Int ( index) ) )
506
+ let targetPtr = UnsafeMutableRawBufferPointer (
507
+ rebasing: self . _slicedStorageBuffer. dropFirst ( Int ( index) )
508
+ )
507
509
targetPtr. copyMemory ( from: bytes)
508
510
}
509
511
@@ -515,7 +517,7 @@ public struct ByteBuffer {
515
517
func ensureCapacityAndReturnStorageBase( capacity: Int ) -> UnsafeMutablePointer < UInt8 > {
516
518
self . _ensureAvailableCapacity ( _Capacity ( capacity) , at: index)
517
519
let newBytesPtr = UnsafeMutableRawBufferPointer (
518
- fastRebase : self . _slicedStorageBuffer [ Int ( index) ..< Int ( index) + Int( capacity) ]
520
+ rebasing : self . _slicedStorageBuffer [ Int ( index) ..< Int ( index) + Int( capacity) ]
519
521
)
520
522
return newBytesPtr. bindMemory ( to: UInt8 . self) . baseAddress!
521
523
}
@@ -659,7 +661,7 @@ public struct ByteBuffer {
659
661
self . _copyStorageAndRebaseIfNeeded ( )
660
662
// this is safe because we always know that readerIndex >= writerIndex
661
663
let range = Range < Int > ( uncheckedBounds: ( lower: self . readerIndex, upper: self . writerIndex) )
662
- return try body ( . init( fastRebase : self . _slicedStorageBuffer [ range] ) )
664
+ return try body ( . init( rebasing : self . _slicedStorageBuffer [ range] ) )
663
665
}
664
666
665
667
/// Yields the bytes currently writable (`bytesWritable` = `capacity` - `writerIndex`). Before reading those bytes you must first
@@ -677,7 +679,7 @@ public struct ByteBuffer {
677
679
_ body: ( UnsafeMutableRawBufferPointer ) throws -> T
678
680
) rethrows -> T {
679
681
self . _copyStorageAndRebaseIfNeeded ( )
680
- return try body ( . init( fastRebase : self . _slicedStorageBuffer. dropFirst ( self . writerIndex) ) )
682
+ return try body ( . init( rebasing : self . _slicedStorageBuffer. dropFirst ( self . writerIndex) ) )
681
683
}
682
684
683
685
/// This vends a pointer of the `ByteBuffer` at the `writerIndex` after ensuring that the buffer has at least `minimumWritableBytes` of writable bytes available.
@@ -748,7 +750,7 @@ public struct ByteBuffer {
748
750
public func withUnsafeReadableBytes< T> ( _ body: ( UnsafeRawBufferPointer ) throws -> T ) rethrows -> T {
749
751
// This is safe, writerIndex >= readerIndex
750
752
let range = Range < Int > ( uncheckedBounds: ( lower: self . readerIndex, upper: self . writerIndex) )
751
- return try body ( . init( fastRebase : self . _slicedStorageBuffer [ range] ) )
753
+ return try body ( . init( rebasing : self . _slicedStorageBuffer [ range] ) )
752
754
}
753
755
754
756
/// Yields a buffer pointer containing this `ByteBuffer`'s readable bytes. You may hold a pointer to those bytes
@@ -769,7 +771,7 @@ public struct ByteBuffer {
769
771
let storageReference : Unmanaged < AnyObject > = Unmanaged . passUnretained ( self . _storage)
770
772
// This is safe, writerIndex >= readerIndex
771
773
let range = Range < Int > ( uncheckedBounds: ( lower: self . readerIndex, upper: self . writerIndex) )
772
- return try body ( . init( fastRebase : self . _slicedStorageBuffer [ range] ) , storageReference)
774
+ return try body ( . init( rebasing : self . _slicedStorageBuffer [ range] ) , storageReference)
773
775
}
774
776
775
777
/// See `withUnsafeReadableBytesWithStorageManagement` and `withVeryUnsafeBytes`.
@@ -1120,7 +1122,7 @@ extension ByteBuffer {
1120
1122
self . _ensureAvailableCapacity ( _Capacity ( length) , at: _toIndex ( toIndex) )
1121
1123
self . withVeryUnsafeMutableBytes { ptr in
1122
1124
let srcPtr = UnsafeRawBufferPointer ( start: ptr. baseAddress!. advanced ( by: fromIndex) , count: length)
1123
- let targetPtr = UnsafeMutableRawBufferPointer ( fastRebase : ptr. dropFirst ( toIndex) )
1125
+ let targetPtr = UnsafeMutableRawBufferPointer ( rebasing : ptr. dropFirst ( toIndex) )
1124
1126
targetPtr. copyMemory ( from: srcPtr)
1125
1127
}
1126
1128
0 commit comments