[llvm] [NFC][VPlan] Simplify VPValue::removeUser (PR #74708)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 9 05:05:29 PST 2023


================
@@ -121,18 +121,11 @@ class VPValue {
 
   /// Remove a single \p User from the list of users.
   void removeUser(VPUser &User) {
-    bool Found = false;
     // The same user can be added multiple times, e.g. because the same VPValue
     // is used twice by the same VPUser. Remove a single one.
-    erase_if(Users, [&User, &Found](VPUser *Other) {
-      if (Found)
-        return false;
-      if (Other == &User) {
-        Found = true;
-        return true;
-      }
-      return false;
-    });
+    auto *I = llvm::find(Users, &User);
----------------
fhahn wrote:

nit: `llvm::` shouldn't be necessary.

https://github.com/llvm/llvm-project/pull/74708


More information about the llvm-commits mailing list