File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -967,7 +967,8 @@ extension ArraySlice: RangeReplaceableCollection {
967
967
start: startNewElements,
968
968
count: self . capacity - oldCount)
969
969
970
- _ = buf. initialize ( fromContentsOf: newElements)
970
+ let end = buf. initialize ( fromContentsOf: newElements)
971
+ _precondition ( end == buf. endIndex)
971
972
_buffer. count += newElementsCount
972
973
}
973
974
Original file line number Diff line number Diff line change @@ -860,7 +860,8 @@ extension ContiguousArray: RangeReplaceableCollection {
860
860
start: startNewElements,
861
861
count: _buffer. mutableCapacity - oldCount)
862
862
863
- _ = buf. initialize ( fromContentsOf: newElements)
863
+ let end = buf. initialize ( fromContentsOf: newElements)
864
+ _precondition ( end == buf. endIndex)
864
865
_buffer. count += newElementsCount
865
866
}
866
867
You can’t perform that action at this time.
0 commit comments