From 7b66739a9fc23238515f0ed0649474dbf664502a Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 3 Sep 2025 10:47:09 -0700 Subject: [PATCH] [ADT] Simplify EnumeratedArray::operator[] (NFC) This patch simplifies EnumeratedArray::operator[] with the injected-class-name. --- llvm/include/llvm/ADT/EnumeratedArray.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/include/llvm/ADT/EnumeratedArray.h b/llvm/include/llvm/ADT/EnumeratedArray.h index fd0700c8e408a..93e1327306175 100644 --- a/llvm/include/llvm/ADT/EnumeratedArray.h +++ b/llvm/include/llvm/ADT/EnumeratedArray.h @@ -57,8 +57,7 @@ class EnumeratedArray { } ValueType &operator[](Enumeration Index) { return const_cast( - static_cast &>(*this)[Index]); + static_cast(*this)[Index]); } IndexType size() const { return Size; } bool empty() const { return size() == 0; }