Commit Graph

1 Commits

Author SHA1 Message Date
Bob Nystrom
adad9f4b26 fix: prevent duplicate keys by reusing tombstones in map probe sequence
Previously, when inserting a key that already existed in the map but was
located after a tombstone in the probe sequence, the insertion would stop
at the first tombstone and add the key there, resulting in duplicate
entries for the same key. This fix introduces a `findEntry` function that
tracks the first encountered tombstone during probing and reuses it for
insertion only when the key is not found elsewhere in the sequence.
2016-06-27 14:14:52 +00:00