Merge remote-tracking branch 'origin' into swift-3-api-guidelines

This commit is contained in:
Max Moiseev
2015-12-22 11:36:07 -08:00
208 changed files with 2902 additions and 2057 deletions

View File

@@ -46,7 +46,8 @@ extension String {
if idx == core.endIndex {
return nil
}
return self.core[idx++]
defer { idx += 1 }
return self.core[idx]
}
}
@@ -73,8 +74,8 @@ extension String {
/// - Requires: The previous value is representable.
@warn_unused_result
public func predecessor() -> Index {
var i = _position
let codeUnit = _core[--i]
var i = _position-1
let codeUnit = _core[i]
if _slowPath((codeUnit >> 10) == 0b1101_11) {
if i != 0 && (_core[i - 1] >> 10) == 0b1101_10 {
i -= 1