diff --git a/Sources/HashTreeCollections/HashNode/_HashNode+Subtree Insertions.swift b/Sources/HashTreeCollections/HashNode/_HashNode+Subtree Insertions.swift index d47a2dea..6e07287d 100644 --- a/Sources/HashTreeCollections/HashNode/_HashNode+Subtree Insertions.swift +++ b/Sources/HashTreeCollections/HashNode/_HashNode+Subtree Insertions.swift @@ -472,10 +472,6 @@ extension _HashNode { assert(!isCollisionNode) let item = read { $0[item: itemSlot] } let hash = _Hash(item.key) - // `newChild` is installed as a child of `self` at `bucket`, so it sits one - // level below `self`. The item must be inserted using that deeper level, - // otherwise it is placed using this node's hash digit rather than the - // child's, corrupting the path to it. let r = newChild.inserting(level.descend(), item, hash) return _copyNodeAndReplaceItemWithNewChild( level: level, diff --git a/Tests/HashTreeCollectionsTests/TreeSet Tests.swift b/Tests/HashTreeCollectionsTests/TreeSet Tests.swift index 2d94ece3..fea85653 100644 --- a/Tests/HashTreeCollectionsTests/TreeSet Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeSet Tests.swift @@ -561,11 +561,6 @@ class TreeSetTests: CollectionTestCase { } func test_union_pushing_item_into_new_child() { - // Regression test: when `union` pushes an existing item down into a newly - // created child node, the item has to be positioned using the child's - // level rather than the parent's. Using the parent's level files both the - // item and the incoming subtree under the wrong path, leaving members that - // iteration still reports but `contains` can no longer find. let a1 = RawCollider(1, "A") // level-0 bucket = 10 let a2 = RawCollider(2, "B") // level-0 bucket = 11 let c1 = RawCollider(5, "ACAD") // same hash → collision node at depth 4