From c28f689cd0c05fd73c9eacda7f3ceb193093304d Mon Sep 17 00:00:00 2001 From: Evan Brown Date: Tue, 20 Feb 2024 14:34:43 -0800 Subject: Use const_cast to avoid duplicating the implementation of raw_hash_set::find(key). Motivation: the implementation becomes more complicated with small object optimization. PiperOrigin-RevId: 608742838 Change-Id: I55fc42321b1967f9c7bbee49817a2f2d4ee44b56 --- absl/container/internal/raw_hash_set.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'absl/container/internal/raw_hash_set.h') diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index cef042e7..7eacfa8c 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h @@ -2849,8 +2849,7 @@ class raw_hash_set { template const_iterator find(const key_arg& key) const ABSL_ATTRIBUTE_LIFETIME_BOUND { - prefetch_heap_block(); - return find(key, hash_ref()(key)); + return const_cast(this)->find(key); } template -- cgit v1.2.3