[Mlir-commits] [mlir] 9915418 - Apply clang-tidy fixes for modernize-use-emplace in Barvinok.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Mon Mar 4 23:15:25 PST 2024


Author: Mehdi Amini
Date: 2024-03-04T23:15:10-08:00
New Revision: 991541814459bbee94db178a1328d344b2869d59

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

LOG: Apply clang-tidy fixes for modernize-use-emplace in Barvinok.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Analysis/Presburger/Barvinok.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/Presburger/Barvinok.cpp b/mlir/lib/Analysis/Presburger/Barvinok.cpp
index da45bdc6a978bd..26039811f0b090 100644
--- a/mlir/lib/Analysis/Presburger/Barvinok.cpp
+++ b/mlir/lib/Analysis/Presburger/Barvinok.cpp
@@ -640,7 +640,7 @@ std::vector<QuasiPolynomial> getBinomialCoefficients(QuasiPolynomial n,
   unsigned numParams = n.getNumInputs();
   std::vector<QuasiPolynomial> coefficients;
   coefficients.reserve(r + 1);
-  coefficients.push_back(QuasiPolynomial(numParams, 1));
+  coefficients.emplace_back(numParams, 1);
   for (unsigned j = 1; j <= r; ++j)
     // We use the recursive formula for binomial coefficients here and below.
     coefficients.push_back(
@@ -655,7 +655,7 @@ std::vector<QuasiPolynomial> getBinomialCoefficients(QuasiPolynomial n,
 std::vector<Fraction> getBinomialCoefficients(Fraction n, Fraction r) {
   std::vector<Fraction> coefficients;
   coefficients.reserve((int64_t)floor(r));
-  coefficients.push_back(1);
+  coefficients.emplace_back(1);
   for (unsigned j = 1; j <= r; ++j)
     coefficients.push_back(coefficients[j - 1] * (n - (j - 1)) / (j));
   return coefficients;


        


More information about the Mlir-commits mailing list