[llvm] [TableGen] Use std::move instead of swap. NFC. (PR #81606)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 06:15:32 PST 2024


================
@@ -1270,11 +1270,10 @@ void AsmMatcherInfo::buildRegisterClasses(
       }
 
       RegisterSet Tmp;
-      std::swap(Tmp, ContainingSet);
-      std::insert_iterator<RegisterSet> II(ContainingSet,
-                                           ContainingSet.begin());
-      std::set_intersection(Tmp.begin(), Tmp.end(), RS.begin(), RS.end(), II,
-                            LessRecordByID());
+      std::insert_iterator<RegisterSet> II(Tmp, Tmp.begin());
+      std::set_intersection(ContainingSet.begin(), ContainingSet.end(),
+                            RS.begin(), RS.end(), II, LessRecordByID());
----------------
s-barannikov wrote:

Could use `std::inserter` here.


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


More information about the llvm-commits mailing list