[stdlib] Don’t use assert() in the stdlib

assert() is designed to be used in user code only; the equivalent stdlib function is called _internalInvariant().

rdar://57101013
This commit is contained in:
Karoy Lorentey
2019-12-11 19:23:46 -08:00
parent 909192c4dc
commit d83a4257f0
5 changed files with 6 additions and 5 deletions

View File

@@ -108,7 +108,7 @@ extension UnsafeBufferPointer where Element == UInt8 {
if index == 0 || index == count {
return true
}
assert(!UTF8.isContinuation(self[_unchecked: index]))
_internalInvariant(!UTF8.isContinuation(self[_unchecked: index]))
// Sub-300 latiny fast-path
if self[_unchecked: index] < 0xCC { return true }