Skip to content

Commit

Permalink
Bug 1860451 - Add documentation for the hash inequality in HashPolicy…
Browse files Browse the repository at this point in the history
…::match. r=mgaudet DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D191591
  • Loading branch information
arai-a committed Oct 31, 2023
1 parent 14ea034 commit 18c6b5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mfbt/HashTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,12 @@ class HashSet {
// - a static member function |HP::match| that tests equality of key and
// lookup values:
//
// static bool match(const Key&, const Lookup&);
// static bool match(const Key& aKey, const Lookup& aLookup);
//
// |aKey| and |aLookup| can have different hash numbers, only when a
// collision happens with |prepareHash| operation, which is less frequent.
// Thus, |HP::match| shouldn't assume the hash equality in the comparison,
// even if the hash numbers are almost always same between them.
//
// Normally, Lookup = Key. In general, though, different values and types of
// values can be used to lookup and store. If a Lookup value |l| is not equal
Expand Down

0 comments on commit 18c6b5d

Please sign in to comment.