Skip to content

Commit

Permalink
Add operator== for F14HashedKey
Browse files Browse the repository at this point in the history
Summary: As per title, just a small convenience thing to save writing `.getKey`.

Reviewed By: Gownta

Differential Revision: D53271948

fbshipit-source-id: f49f1533d755937f5827855cf7dbf56b336099f9
  • Loading branch information
Hillsoft authored and facebook-github-bot committed Feb 2, 2024
1 parent b934faa commit e85f634
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions folly/container/detail/F14Table.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ class F14HashedKey final {
explicit operator const TKeyType&() const { return key_; }
explicit operator const F14HashToken&() const { return hash_; }

bool operator==(const F14HashedKey& other) const {
return key_ == other.key_;
}
bool operator==(const TKeyType& other) const { return key_ == other; }

private:
F14HashToken hash_;
TKeyType key_;
Expand Down

0 comments on commit e85f634

Please sign in to comment.