[TreeDictionary] merge: Add missing invariant checks

The lack of these calls allowed our tests to pass even though the
implementation is failing to properly update the count. D’oh!

This and the previous commits adds a myriad new test failures.
This commit is contained in:
Karoy Lorentey committed 2022-11-30 14:29:53 -08:00
1 parent a6392bf578
commit 5b37259155
1 file changed
+3 -1
@@ -43,7 +43,8 @@ extension TreeDictionary {
uniquingKeysWith combine: (Value, Value) throws -> Value
) rethrows {
_invalidateIndices()
try _root.merge(.top, keysAndValues._root, combine)
_ = try _root.merge(.top, keysAndValues._root, combine)
_invariantCheck()
}
/// Merges the key-value pairs in the given sequence into the dictionary,
@@ -87,6 +88,7 @@ extension TreeDictionary {
}
}
}
_invariantCheck()
}
/// Merges the key-value pairs in the given sequence into the dictionary,