From dc7f8e73ea6aef12f401348ae29fffeae1dcabab Mon Sep 17 00:00:00 2001 From: Antti Soininen <soininen@ill.fr> Date: Thu, 21 Jun 2018 08:27:45 +0200 Subject: [PATCH] MultiFileNameParser: simplify emplace_back calls. Re #22597 --- Framework/Kernel/src/MultiFileNameParser.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Framework/Kernel/src/MultiFileNameParser.cpp b/Framework/Kernel/src/MultiFileNameParser.cpp index d6d5a02384b..8232a6c2118 100644 --- a/Framework/Kernel/src/MultiFileNameParser.cpp +++ b/Framework/Kernel/src/MultiFileNameParser.cpp @@ -446,12 +446,8 @@ void RunRangeList::addRunRange( namespace // anonymous { /** - * Parses a string containing a run "token". - * - * Note that this function takes the form required by the "accumulate" - *algorithm: - * it takes in the parsed runs so far and a new token to parse, and then returns - * the result of appending the newly parsed token to the already parsed runs. + * Parses a string containing a run "token" and adds the runs to the parsedRuns + * vector. * * @param parsedRuns :: the vector of vectors of runs parsed so far. * @param token :: the token to parse. @@ -581,11 +577,11 @@ generateRange(unsigned int const from, unsigned int const to, while (currentRun <= to) { if (addRuns) { if (runs.empty()) - runs.emplace_back(std::vector<unsigned int>(1, currentRun)); + runs.emplace_back(1, currentRun); else runs.front().emplace_back(currentRun); } else { - runs.emplace_back(std::vector<unsigned int>(1, currentRun)); + runs.emplace_back(1, currentRun); } currentRun += stepSize; @@ -596,11 +592,11 @@ generateRange(unsigned int const from, unsigned int const to, while (currentRun >= to) { if (addRuns) { if (runs.empty()) - runs.emplace_back(std::vector<unsigned int>(1, currentRun)); + runs.emplace_back(1, currentRun); else runs.front().emplace_back(currentRun); } else { - runs.emplace_back(std::vector<unsigned int>(1, currentRun)); + runs.emplace_back(1, currentRun); } // Guard against case where stepSize would take us into negative -- GitLab