mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
_Rope: Add a leaf node reference to indices. Implement explicit index invalidation
This commit is contained in:
21 files changed
+671
-281
No files matched your search
@@ -36,7 +36,8 @@ extension _BString {
|
||||
// full grapheme breaking state of the ingester at the start of the insertion.
|
||||
// (We'll use it to resync grapheme breaks in the parts that follow the insertion.)
|
||||
var (ingester, _, path) = ingester(forInserting: other, at: index, allowForwardPeek: false)
|
||||
let r = rope[path.rope].insert(from: &ingester, at: path.chunk)
|
||||
let i = path.chunk
|
||||
let r = rope.update(at: &path.rope) { $0.insert(from: &ingester, at: i) }
|
||||
switch r {
|
||||
case let .inline(r):
|
||||
assert(ingester.isAtEnd)
|
||||
|
||||
Reference in new issue
Block a user