Sandeep Vijayarao
503047e77a
[Rope] Don't take the same-leaf fast path in distance(from:to:in:) for shared leaves
...
A rope may contain the same leaf node at multiple positions (e.g. after
appending a rope to itself, or inserting a BigString slice into its own
base). Rope.distance(from:to:in:) assumed that two indices with the same
cached leaf reference address the same position in the tree, and returned
a distance computed only from their leaf slots. Also compare the paths
above the leaf level before taking the fast path.
This made BigString's character/scalar/UTF-16 distances and
index(_:offsetBy:) return wrong results (including indices with a bogus
utf8Offset) after such operations.
2026-11-16 18:50:37 -08:00
Karoy Lorentey
1c69635852
Add SPDX-License-Identifier tags
2026-03-05 19:39:24 -08:00
Karoy Lorentey
d9b09ecde8
Update copyright dates
2026-03-05 19:39:20 -08:00
Karoy Lorentey
54c65310f4
Adopt #filePath in test assertions
2025-08-17 13:23:00 -07:00
Karoy Lorentey
6c31865359
[test] Add tests for Rope.join’s copy-on-write behavior
2024-05-31 16:59:25 -07:00
Karoy Lorentey
ffa4a58bc1
Update remaining copyright notices
2024-02-02 16:20:22 -08:00
Karoy Lorentey
03e7f0c401
[Rope] Fix find to return a zero remainder for the end position
2023-06-02 17:37:30 -07:00
Karoy Lorentey
03c9ef743a
[Rope] Fix crash when calling replaceSubrange/removeSubrange on an empty rope
2023-06-01 20:24:24 -07:00
Karoy Lorentey
374c3a4805
Migrate rope tests to CollectionsTestSupport assertions
2023-06-01 20:23:49 -07:00
Karoy Lorentey
3fa52c48de
[Rope] Add remove(at:), remove(at:in:) variants that preserve the position
2023-04-13 19:36:09 -07:00
Karoy Lorentey
cead2b3d64
[Rope] index(_:offsetBy:in:preferEnd:) fix result tuple labeling
...
This renames `remainder` to `remaining`, restoring API consistency.
2023-04-12 17:54:13 -07:00
Karoy Lorentey
ea60d293b4
Fix test issues with single-module variant
2023-03-21 18:43:46 -07:00
Karoy Lorentey
cbab9e3737
Introduce COLLECTIONS_SINGLE_MODULE condition
2023-03-21 18:42:33 -07:00
Karoy Lorentey
8394ea7575
Clean up test definitions
2023-03-21 01:30:03 -07:00
Karoy Lorentey
ad82bc3f80
Naming review
2023-03-21 01:21:43 -07:00
Karoy Lorentey
6f3f19d1c5
_Rope → Rope
2023-03-20 23:49:57 -07:00
Karoy Lorentey
0ad7f0ce38
_BString → BigString
2023-03-20 21:20:30 -07:00
Karoy Lorentey
09577a31ee
RopeModule→_RopeModule. Stop reexporting it from Collections.
...
This module is not source stable; mark it as such by prepending
the module name with an underscore.
2023-03-20 16:47:56 -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
150a165d73
Add experimental rope implementation
2023-03-20 13:11:21 -07:00