[Mlir-commits] [mlir] dabfefa - Fix clang-tidy performance-move-const-arg in DLTI Dialect (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sat Dec 25 18:21:28 PST 2021


Author: Mehdi Amini
Date: 2021-12-26T02:13:54Z
New Revision: dabfefa490570e720249070db68cc48cdddab82c

URL: https://github.com/llvm/llvm-project/commit/dabfefa490570e720249070db68cc48cdddab82c
DIFF: https://github.com/llvm/llvm-project/commit/dabfefa490570e720249070db68cc48cdddab82c.diff

LOG: Fix clang-tidy performance-move-const-arg in DLTI Dialect (NFC)

The const loop iterator was inhibiting the std::move().

Added: 
    

Modified: 
    mlir/lib/Dialect/DLTI/DLTI.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/DLTI/DLTI.cpp b/mlir/lib/Dialect/DLTI/DLTI.cpp
index c35572bbf1d4..1449a2c4691f 100644
--- a/mlir/lib/Dialect/DLTI/DLTI.cpp
+++ b/mlir/lib/Dialect/DLTI/DLTI.cpp
@@ -201,7 +201,7 @@ combineOneSpec(DataLayoutSpecInterface spec,
   spec.bucketEntriesByType(newEntriesForType, newEntriesForID);
 
   // Try overwriting the old entries with the new ones.
-  for (const auto &kvp : newEntriesForType) {
+  for (auto &kvp : newEntriesForType) {
     if (!entriesForType.count(kvp.first)) {
       entriesForType[kvp.first] = std::move(kvp.second);
       continue;


        


More information about the Mlir-commits mailing list