Skip to content

Commit 552ee3c

Browse files
[ADT] Add const to AllocatorList::{empty,size} (#161320)
While I am at it, this patch adds [[nodiscard]].
1 parent 95069c1 commit 552ee3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/ADT/AllocatorList.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ template <class T, class AllocatorT> class AllocatorList : AllocatorT {
155155
std::swap(getAlloc(), RHS.getAlloc());
156156
}
157157

158-
bool empty() { return List.empty(); }
159-
size_t size() { return List.size(); }
158+
[[nodiscard]] bool empty() const { return List.empty(); }
159+
[[nodiscard]] size_t size() const { return List.size(); }
160160

161161
iterator begin() { return iterator(List.begin()); }
162162
iterator end() { return iterator(List.end()); }

0 commit comments

Comments
 (0)