From dc5586d030effd9755e0e8cddfca46ddd7ea45eb Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Mon, 22 Jul 2024 12:39:32 -0700 Subject: [PATCH] let F14HashToken equality-comparison skip the tag element Summary: It only needs to compare the hash element and can skip comparing the derived tag element. The derived tag element is indended as a precomputed word to accelerate lookup but only decelerates equality-comparison. Reviewed By: DenisYaroshevskiy Differential Revision: D60044472 fbshipit-source-id: 7b18667b993b817b1ce3c78667693f5f12fb48e5 --- folly/container/detail/F14Table.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/container/detail/F14Table.h b/folly/container/detail/F14Table.h index ca5766fb201..138d986c097 100644 --- a/folly/container/detail/F14Table.h +++ b/folly/container/detail/F14Table.h @@ -214,11 +214,11 @@ class F14HashToken final { friend constexpr bool operator==( F14HashToken const& a, F14HashToken const& b) noexcept { - return a.hp_ == b.hp_; + return a.hp_.first == b.hp_.first; // processed hash but not tag } friend constexpr bool operator!=( F14HashToken const& a, F14HashToken const& b) noexcept { - return a.hp_ != b.hp_; + return !(a == b); } private: