From: Jannik Silvanus Date: Tue, 18 Oct 2022 11:26:32 +0000 (+0200) Subject: [NFC][ADT] Clean up EnumeratedArray.h X-Git-Tag: upstream/17.0.6~30270 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=599f261c9258e1e1d7f8228cc5ae88b4fa6f846d;p=platform%2Fupstream%2Fllvm.git [NFC][ADT] Clean up EnumeratedArray.h As discussed in D135594, remove superfluous inline attributes, and remove top-level consts on function arguments. --- 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];