mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] all sorts of require renamed back to precondition
This commit is contained in:
@@ -149,7 +149,7 @@ extension String {
|
||||
}
|
||||
else {
|
||||
// Produce the endIndex
|
||||
_require(
|
||||
_precondition(
|
||||
nextCoreIndex == _core.endIndex,
|
||||
"Can't increment past endIndex of String.UTF8View")
|
||||
return Index(_core, nextCoreIndex, nextBuffer)
|
||||
@@ -216,7 +216,7 @@ extension String {
|
||||
/// `position != endIndex`.
|
||||
public subscript(position: Index) -> UTF8.CodeUnit {
|
||||
let result: UTF8.CodeUnit = numericCast(position._buffer & 0xFF)
|
||||
_require(result != 0xFF, "cannot subscript using endIndex")
|
||||
_precondition(result != 0xFF, "cannot subscript using endIndex")
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ extension String.UTF8View.Index {
|
||||
|
||||
if utf16Index != utf16.startIndex
|
||||
&& utf16Index != utf16.endIndex {
|
||||
_require(
|
||||
_precondition(
|
||||
utf16Index >= utf16.startIndex
|
||||
&& utf16Index <= utf16.endIndex,
|
||||
"Invalid String.UTF16Index for this UTF-8 view")
|
||||
|
||||
Reference in New Issue
Block a user