From fe49f64f09bca527eff4b78d047301220e4fc1fc Mon Sep 17 00:00:00 2001 From: Gunhyun Park Date: Thu, 9 Feb 2023 15:18:16 -0800 Subject: [PATCH] Use const reference for loop variable to avoid copy (#1095) Manually fixing as part of clang-tidy check which is currently not supported in StableHLO #61 --- stablehlo/dialect/StablehloOps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stablehlo/dialect/StablehloOps.cpp b/stablehlo/dialect/StablehloOps.cpp index d763b3f27b4..749bfa31bae 100644 --- a/stablehlo/dialect/StablehloOps.cpp +++ b/stablehlo/dialect/StablehloOps.cpp @@ -2821,7 +2821,7 @@ void printConvolutionDimensions(AsmPrinter& p, ConvDimensionNumbersAttr dnums) { for (const std::pair& nonSpatialDim : non_spatialDims) dims[nonSpatialDim.first] = nonSpatialDim.second; - for (auto spatial_dim : llvm::enumerate(spatialDims)) + for (const auto& spatial_dim : llvm::enumerate(spatialDims)) dims[spatial_dim.value()] = static_cast(spatial_dim.index()); // Each dimension numbers will be printed as a comma separated list