================
@@ -206,11 +196,12 @@ class SmallSet {
   bool erase(const T &V) {
     if (!isSmall())
       return Set.erase(V);
-    for (mutable_iterator I = Vector.begin(), E = Vector.end(); I != E; ++I)
-      if (*I == V) {
-        Vector.erase(I);
-        return true;
-      }
+
+    auto It = llvm::find(Vector, V);
+    if (It != Vector.end()) {
----------------
kuhar wrote:

nit: this is not used outside of the `if`
```suggestion
    if (auto It = llvm::find(Vector, V); It != Vector.end()) {
```

https://github.com/llvm/llvm-project/pull/108585
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to