NIOCore: Implemented all three variants of _failEarlyRangeCheck methods for ByteBufferView (#2226)
* NIOCore: Implemented all three variants of _failEarlyRangeCheck methods for ByteBufferView * _failEarlyRangeCheck is now no-op
This commit is contained in:
parent
b99da5d3fe
commit
dd3b25449a
|
@ -137,6 +137,16 @@ public struct ByteBufferView: RandomAccessCollection, NIOSendable {
|
||||||
let iterator = self[self.endIndex..<self.endIndex].makeIterator()
|
let iterator = self[self.endIndex..<self.endIndex].makeIterator()
|
||||||
return (iterator, bytesToWrite)
|
return (iterator, bytesToWrite)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// These are implemented as no-ops for performance reasons.
|
||||||
|
@inlinable
|
||||||
|
public func _failEarlyRangeCheck(_ index: Index, bounds: Range<Index>) {}
|
||||||
|
|
||||||
|
@inlinable
|
||||||
|
public func _failEarlyRangeCheck(_ index: Index, bounds: ClosedRange<Index>) {}
|
||||||
|
|
||||||
|
@inlinable
|
||||||
|
public func _failEarlyRangeCheck(_ range: Range<Index>, bounds: Range<Index>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ByteBufferView: MutableCollection {}
|
extension ByteBufferView: MutableCollection {}
|
||||||
|
|
Loading…
Reference in New Issue