UnicodeScalar => Unicode.Scalar

This commit is contained in:
Dave Abrahams
2017-05-10 15:52:52 -07:00
parent 97f875ad84
commit ddf7ad517f
38 changed files with 286 additions and 280 deletions

View File

@@ -451,13 +451,13 @@ extension String.CharacterView : BidirectionalCollection {
// pass.
if relativeOffset >= asciiBuffer.startIndex &&
relativeOffset < asciiBuffer.endIndex {
return Character(UnicodeScalar(asciiBuffer[relativeOffset]))
return Character(Unicode.Scalar(asciiBuffer[relativeOffset]))
}
} else if _core._baseAddress != nil {
let cu = _core._nthContiguous(relativeOffset)
// Only constructible if sub-surrogate
if (cu < 0xd800) {
return Character(UnicodeScalar(cu)._unsafelyUnwrappedUnchecked)
return Character(Unicode.Scalar(cu)._unsafelyUnwrappedUnchecked)
}
}
}