mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
[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:
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,
|
||||
|
||||
Reference in new issue
Block a user