Apply clang-tidy fixes for performance-unnecessary-value-param in IRAttributes.cpp...
authorMehdi Amini <joker.eph@gmail.com>
Mon, 29 Aug 2022 10:06:17 +0000 (10:06 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 29 Aug 2022 12:33:05 +0000 (12:33 +0000)
mlir/lib/Bindings/Python/IRAttributes.cpp

index f9c7f6f..8d8cea3 100644 (file)
@@ -120,7 +120,7 @@ public:
   /// Iterator over the integer elements of a dense array.
   class PyDenseArrayIterator {
   public:
-    PyDenseArrayIterator(PyAttribute attr) : attr(attr) {}
+    PyDenseArrayIterator(PyAttribute attr) : attr(std::move(attr)) {}
 
     /// Return a copy of the iterator.
     PyDenseArrayIterator dunderIter() { return *this; }
@@ -174,7 +174,7 @@ public:
     });
     c.def("__iter__",
           [](const DerivedT &arr) { return PyDenseArrayIterator(arr); });
-    c.def("__add__", [](DerivedT &arr, py::list extras) {
+    c.def("__add__", [](DerivedT &arr, const py::list &extras) {
       std::vector<EltTy> values;
       intptr_t numOldElements = mlirDenseArrayGetNumElements(arr);
       values.reserve(numOldElements + py::len(extras));