From 578e4eca82132ddbb9475409d0b1a982f61da816 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sat, 23 Jun 2018 11:39:47 +0900 Subject: sccomp: Reserve enough space at once for micro-optimization Change-Id: Ib4e178d2a0f09cb44854f1d1aad026d8394a8917 Reviewed-on: https://gerrit.libreoffice.org/56312 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Julien Nabet --- sccomp/source/solver/CoinMPSolver.cxx | 1 + sccomp/source/solver/DifferentialEvolution.hxx | 1 + sccomp/source/solver/LpsolveSolver.cxx | 1 + sccomp/source/solver/ParticelSwarmOptimization.hxx | 1 + 4 files changed, 4 insertions(+) (limited to 'sccomp') diff --git a/sccomp/source/solver/CoinMPSolver.cxx b/sccomp/source/solver/CoinMPSolver.cxx index 2b1ddd7227d7..23426e140e42 100644 --- a/sccomp/source/solver/CoinMPSolver.cxx +++ b/sccomp/source/solver/CoinMPSolver.cxx @@ -63,6 +63,7 @@ void SAL_CALL CoinMPSolver::solve() // collect variables in vector (?) std::vector aVariableCells; + aVariableCells.reserve(maVariables.getLength()); for (sal_Int32 nPos=0; nPos aVariableCells; + aVariableCells.reserve(maVariables.getLength()); for (sal_Int32 nPos=0; nPos::lowest(); + maSwarm.reserve(mnNumOfParticles); for (size_t i = 0; i < mnNumOfParticles; i++) { maSwarm.emplace_back(mnDimensionality); -- cgit