Commit Graph
13 Commits
Author SHA1 Message Date
Karoy Lorentey 9bbdfdc497 Cosmetic updates to _BString.CharacterIterator 2023-03-20 13:12:10 -07:00
Karoy Lorentey 79bdcb66eb Implement path caching in indices 2023-03-20 13:12:10 -07:00
Karoy Lorentey b6f9d83c60 Replace Rope iterator with indices in most index-like use cases 2023-03-20 13:12:09 -07:00
Karoy Lorentey 3cc5a3888a _Rope: Add a leaf node reference to indices. Implement explicit index invalidation 2023-03-20 13:12:09 -07:00
Karoy Lorentey 8f48c3ae37 More assorted bug fixes and refinements 2023-03-20 13:12:09 -07:00
Karoy Lorentey 8c1740ad28 _Rope.Index: Merge height into UInt64 storage.
This leaves 56 bits for path data, which should still be plenty.
(We want to allow big strings to grow to 2^48 UTF-8 code units, to
match the standard String; however, there is no practical need to
support any more, and even that is a stretch.)

Add tests to verify that the tree capacity matches expectations
in Release builds. (In Debug builds, we limit the maximum node size,
which drastically reduces capacity. This is okay.)
2023-03-20 13:12:09 -07:00
Karoy Lorentey 67a149da6a _BString: Set better max node size in Release builds
Also, adjust minimum node size calculation to match classic B-trees.
2023-03-20 13:12:09 -07:00
Karoy Lorentey 8c8cb5622b Restrict BIgString and _BString to Swift 5.8 and macOS 13.3 /iOS 16.4/etc
These types heavily rely on stdlib functionality that ships in
Swift 5.8; they do not run correctly on earlier releases.
2023-03-20 13:12:09 -07:00
Karoy Lorentey 283d4071bc Assorted bug fixes and refinements 2023-03-20 13:12:08 -07:00
Karoy Lorentey 96aebb90b7 Fix initializing a String from a _BString slice 2023-03-20 13:12:08 -07:00
Karoy Lorentey 18aa309f75 Generalize some _BString iterators 2023-03-20 13:12:07 -07:00
Karoy Lorentey eabd941799 Add some operations taking subsequences 2023-03-20 13:12:07 -07:00
Karoy Lorentey 150a165d73 Add experimental rope implementation 2023-03-20 13:11:21 -07:00