[libc-commits] [libc] [libc] Fix -Wshadow warning in HashTable/table.h (PR #196857)
Nico Weber via libc-commits
libc-commits at lists.llvm.org
Sun May 10 17:40:55 PDT 2026
https://github.com/nico created https://github.com/llvm/llvm-project/pull/196857
None
>From 717f25785b4bde8189a4fc0fcf222a8aa620349e Mon Sep 17 00:00:00 2001
From: Nico Weber <thakis at chromium.org>
Date: Sun, 10 May 2026 19:23:53 -0400
Subject: [PATCH] [libc] Fix -Wshadow warning in HashTable/table.h
---
libc/src/__support/HashTable/table.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libc/src/__support/HashTable/table.h b/libc/src/__support/HashTable/table.h
index f42eead2efcf2..578f01e0e2c55 100644
--- a/libc/src/__support/HashTable/table.h
+++ b/libc/src/__support/HashTable/table.h
@@ -208,10 +208,10 @@ struct HashTable {
LIBC_INLINE HashTable *grow() const {
size_t hint = full_capacity() + 1;
- HashState state = this->state;
+ HashState new_state = state;
// migrate to a new random state
- state.update(&hint, sizeof(hint));
- HashTable *new_table = allocate(hint, state.finish());
+ new_state.update(&hint, sizeof(hint));
+ HashTable *new_table = allocate(hint, new_state.finish());
// It is safe to call unsafe_insert() because we know that:
// - the new table has enough capacity to hold all the entries
// - there is no duplicate key in the old table
More information about the libc-commits
mailing list