summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar Evan Brown <ezb@google.com>2024-02-20 14:34:43 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2024-02-20 14:35:37 -0800
commitc28f689cd0c05fd73c9eacda7f3ceb193093304d (patch)
tree716055102d38c38d6434cd3c6d0df54df6f3bdbc /absl
parent1449add2f7378f5c67627e1f1a0a86d50d039da7 (diff)
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
Diffstat (limited to 'absl')
-rw-r--r--absl/container/internal/raw_hash_set.h3
1 files changed, 1 insertions, 2 deletions
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 <class K = key_type>
const_iterator find(const key_arg<K>& key) const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
- prefetch_heap_block();
- return find(key, hash_ref()(key));
+ return const_cast<raw_hash_set*>(this)->find(key);
}
template <class K = key_type>