From 599f261c9258e1e1d7f8228cc5ae88b4fa6f846d Mon Sep 17 00:00:00 2001 From: Jannik Silvanus Date: Tue, 18 Oct 2022 13:26:32 +0200 Subject: [PATCH] [NFC][ADT] Clean up EnumeratedArray.h As discussed in D135594, remove superfluous inline attributes, and remove top-level consts on function arguments. --- llvm/include/llvm/ADT/EnumeratedArray.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/ADT/EnumeratedArray.h b/llvm/include/llvm/ADT/EnumeratedArray.h index f54a504..cece71d 100644 --- a/llvm/include/llvm/ADT/EnumeratedArray.h +++ b/llvm/include/llvm/ADT/EnumeratedArray.h @@ -30,17 +30,17 @@ public: Underlying[IX] = V; } } - inline const ValueType &operator[](const Enumeration Index) const { + const ValueType &operator[](Enumeration Index) const { auto IX = static_cast(Index); assert(IX >= 0 && IX < Size && "Index is out of bounds."); return Underlying[IX]; } - inline ValueType &operator[](const Enumeration Index) { + ValueType &operator[](Enumeration Index) { return const_cast( static_cast &>(*this)[Index]); } - inline IndexType size() { return Size; } + IndexType size() { return Size; } private: ValueType Underlying[Size]; -- 2.7.4