From 3d670fe2dfef61bc0da82e9070b552d63715bcc7 Mon Sep 17 00:00:00 2001 From: christos <christos@cern.ch> Date: Tue, 18 Aug 2020 04:14:20 +0100 Subject: [PATCH] KLMixture: Use ctor with num of elements --- .../src/KLGaussianMixtureReduction.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx index 96ccf1db160..0f45d1de637 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx @@ -196,14 +196,12 @@ findMerges(Component1D* componentsIn, const int32_t n = inputSize; const int32_t nn = n * (n - 1) / 2; // Create a trianular mapping for the pairwise distances - std::vector<triangularToIJ> convert; - convert.reserve(nn); - + // We now that the size is nn + std::vector<triangularToIJ> convert(nn); for (int32_t i = 1; i < n; ++i) { const int indexConst = (i - 1) * i / 2; for (int32_t j = 0; j < i; ++j) { - int32_t index = indexConst + j; - convert[index] = { i, j }; + convert[indexConst + j] = { i, j }; } } // We need to work with multiple of 8, in principle this is a requirement -- GitLab