From 2b8efe1ead48ce685e136f75ff401551bfdd4407 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 16 Aug 2025 08:35:41 -0700 Subject: [PATCH] [ADT] Use small_buckets() in SmallPtrSetImpl::remove_if (NFC) --- llvm/include/llvm/ADT/SmallPtrSet.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/ADT/SmallPtrSet.h b/llvm/include/llvm/ADT/SmallPtrSet.h index 0d7fe308a32fb..f55627c6866f7 100644 --- a/llvm/include/llvm/ADT/SmallPtrSet.h +++ b/llvm/include/llvm/ADT/SmallPtrSet.h @@ -435,7 +435,8 @@ class SmallPtrSetImpl : public SmallPtrSetImplBase { bool remove_if(UnaryPredicate P) { bool Removed = false; if (isSmall()) { - const void **APtr = CurArray, **E = CurArray + NumEntries; + auto Buckets = small_buckets(); + const void **APtr = Buckets.begin(), **E = Buckets.end(); while (APtr != E) { PtrType Ptr = PtrTraits::getFromVoidPointer(const_cast(*APtr)); if (P(Ptr)) {