mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
_CharacterRecognizer don’t use conformances that aren’t in the Xcode 14.3 beta
This commit is contained in:
4 files changed
+18
-5
No files matched your search
@@ -113,7 +113,7 @@ extension _BString.Builder {
|
||||
}
|
||||
|
||||
mutating func append(from ingester: inout Ingester) {
|
||||
assert(ingester.state == self.prefixEndState)
|
||||
//assert(ingester.state._isKnownEqual(to: self.prefixEndState))
|
||||
if var prefix = base.prefix._take() {
|
||||
if let first = ingester.nextSlice(maxUTF8Count: prefix.value.availableSpace) {
|
||||
prefix.value._append(first)
|
||||
|
||||
@@ -67,7 +67,7 @@ extension _BString.UTF8Iterator: IteratorProtocol {
|
||||
internal mutating func next() -> UInt8? {
|
||||
guard _index < _base.endIndex else { return nil }
|
||||
// Hand-optimized from `_base.subscript(utf8:)` and `_base.utf8Index(after:)`.
|
||||
var ri = _index._rope!
|
||||
let ri = _index._rope!
|
||||
var ci = _index._chunkIndex
|
||||
let chunk = _base.rope[ri]
|
||||
let result = chunk.string.utf8[ci]
|
||||
@@ -93,7 +93,7 @@ extension _BString.UTF8Iterator: IteratorProtocol {
|
||||
precondition(r.consumed == 0)
|
||||
return r.result
|
||||
}
|
||||
var ri = _index._rope!
|
||||
let ri = _index._rope!
|
||||
var ci = _index._utf8ChunkOffset
|
||||
var utf8Offset = _index._utf8Offset
|
||||
var string = _base.rope[ri].string
|
||||
|
||||
@@ -193,7 +193,7 @@ extension _BString.Chunk {
|
||||
case (true, true):
|
||||
break loop // Resync complete ✨
|
||||
case (false, false):
|
||||
if old == new { break loop }
|
||||
if old._isKnownEqual(to: new) { break loop }
|
||||
case (false, true):
|
||||
counts._characters += 1
|
||||
case (true, false):
|
||||
@@ -259,7 +259,7 @@ extension _BString.Chunk {
|
||||
if i < lastBreak {
|
||||
new = _CharacterRecognizer(partialCharacter: string[lastBreak...])
|
||||
} else {
|
||||
assert(old == new)
|
||||
//assert(old == new)
|
||||
let j = string.unicodeScalars.index(after: i)
|
||||
new.consumePartialCharacter(string[j...])
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user