@@ -688,7 +688,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
688
688
return Int ( length)
689
689
}
690
690
set ( newValue) {
691
- precondition ( newValue <= MemoryLayout< Buffer> . size)
691
+ assert ( newValue <= MemoryLayout< Buffer> . size)
692
692
length = UInt8 ( newValue)
693
693
}
694
694
}
@@ -777,7 +777,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
777
777
assert ( subrange. upperBound <= MemoryLayout< Buffer> . size)
778
778
assert ( count - ( subrange. upperBound - subrange. lowerBound) + replacementLength <= MemoryLayout< Buffer> . size)
779
779
precondition ( subrange. lowerBound <= length, " index \( subrange. lowerBound) is out of bounds of 0..< \( length) " )
780
- precondition ( subrange. upperBound <= length, " index \( subrange. lowerBound ) is out of bounds of 0..< \( length) " )
780
+ precondition ( subrange. upperBound <= length, " index \( subrange. upperBound ) is out of bounds of 0..< \( length) " )
781
781
let currentLength = count
782
782
let resultingLength = currentLength - ( subrange. upperBound - subrange. lowerBound) + replacementLength
783
783
let shift = resultingLength - currentLength
@@ -2188,7 +2188,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
2188
2188
2189
2189
@inlinable // This is @inlinable as trivially forwarding.
2190
2190
internal func _copyBytesHelper( to pointer: UnsafeMutableRawPointer , from range: Range < Int > ) {
2191
- if range. upperBound - range . lowerBound == 0 { return }
2191
+ if range. isEmpty { return }
2192
2192
_representation. copyBytes ( to: pointer, from: range)
2193
2193
}
2194
2194
0 commit comments