[Mlir-commits] [mlir] 36c5753 - [mlir] Apply ClangTidy performance finding.

Adrian Kuegel llvmlistbot at llvm.org
Tue Jul 30 04:20:26 PDT 2024


Author: Adrian Kuegel
Date: 2024-07-30T11:19:26Z
New Revision: 36c57532f528e2d6420c0d205841af8b76c70d6a

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

LOG: [mlir] Apply ClangTidy performance finding.

Added: 
    

Modified: 
    mlir/lib/CAPI/Dialect/SparseTensor.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/CAPI/Dialect/SparseTensor.cpp b/mlir/lib/CAPI/Dialect/SparseTensor.cpp
index 19171d64d4094..f2a0ab33c0224 100644
--- a/mlir/lib/CAPI/Dialect/SparseTensor.cpp
+++ b/mlir/lib/CAPI/Dialect/SparseTensor.cpp
@@ -107,6 +107,7 @@ MlirSparseTensorLevelType mlirSparseTensorEncodingAttrBuildLvlType(
     unsigned size, unsigned n, unsigned m) {
 
   std::vector<LevelPropNonDefault> props;
+  props.reserve(size);
   for (unsigned i = 0; i < size; i++)
     props.push_back(static_cast<LevelPropNonDefault>(properties[i]));
 


        


More information about the Mlir-commits mailing list