[stdlib] all sorts of require renamed back to precondition

This commit is contained in:
Max Moiseev
2016-02-19 18:21:29 -08:00
parent b1ef18fb75
commit 40b1a0b7e0
77 changed files with 360 additions and 378 deletions

View File

@@ -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")