mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user