Skip to content

Commit

Permalink
[TreeDictionary] merge: Add missing invariant checks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lorentey committed Nov 30, 2022
1 parent a6392bf commit 5b37259
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -87,6 +88,7 @@ extension TreeDictionary {
}
}
}
_invariantCheck()
}

/// Merges the key-value pairs in the given sequence into the dictionary,
Expand Down

0 comments on commit 5b37259

Please sign in to comment.