[mlir] Remove no-op array assignment in dictionaryAttrSort().
authorChristian Sigg <csigg@google.com>
Tue, 6 Apr 2021 13:43:49 +0000 (15:43 +0200)
committerChristian Sigg <csigg@google.com>
Tue, 6 Apr 2021 19:30:37 +0000 (21:30 +0200)
Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D99954

mlir/lib/IR/BuiltinAttributes.cpp

index a7b1a6c..8ef7c26 100644 (file)
@@ -79,11 +79,9 @@ static bool dictionaryAttrSort(ArrayRef<NamedAttribute> value,
       storage.assign(value.begin(), value.end());
     // Check to see they are sorted already.
     bool isSorted = llvm::is_sorted(value);
-    if (!isSorted) {
-      // If not, do a general sort.
+    // If not, do a general sort.
+    if (!isSorted)
       llvm::array_pod_sort(storage.begin(), storage.end());
-      value = storage;
-    }
     return !isSorted;
   }
   return false;