@@ -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
@@ -2194,7 +2194,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
2194
2194
2195
2195
@inlinable // This is @inlinable as trivially forwarding.
2196
2196
internal func _copyBytesHelper( to pointer: UnsafeMutableRawPointer , from range: Range < Int > ) {
2197
- if range. upperBound - range . lowerBound == 0 { return }
2197
+ if range. isEmpty { return }
2198
2198
_representation. copyBytes ( to: pointer, from: range)
2199
2199
}
2200
2200
0 commit comments