mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin' into swift-3-api-guidelines
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user