Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
dc7f8e73
Commit
dc7f8e73
authored
6 years ago
by
Antti Soininen
Browse files
Options
Downloads
Patches
Plain Diff
MultiFileNameParser: simplify emplace_back calls. Re #22597
parent
46a6eebc
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Kernel/src/MultiFileNameParser.cpp
+6
-10
6 additions, 10 deletions
Framework/Kernel/src/MultiFileNameParser.cpp
with
6 additions
and
10 deletions
Framework/Kernel/src/MultiFileNameParser.cpp
+
6
−
10
View file @
dc7f8e73
...
@@ -446,12 +446,8 @@ void RunRangeList::addRunRange(
...
@@ -446,12 +446,8 @@ void RunRangeList::addRunRange(
namespace
// anonymous
namespace
// anonymous
{
{
/**
/**
* Parses a string containing a run "token".
* Parses a string containing a run "token" and adds the runs to the parsedRuns
*
* vector.
* 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.
*
*
* @param parsedRuns :: the vector of vectors of runs parsed so far.
* @param parsedRuns :: the vector of vectors of runs parsed so far.
* @param token :: the token to parse.
* @param token :: the token to parse.
...
@@ -581,11 +577,11 @@ generateRange(unsigned int const from, unsigned int const to,
...
@@ -581,11 +577,11 @@ generateRange(unsigned int const from, unsigned int const to,
while
(
currentRun
<=
to
)
{
while
(
currentRun
<=
to
)
{
if
(
addRuns
)
{
if
(
addRuns
)
{
if
(
runs
.
empty
())
if
(
runs
.
empty
())
runs
.
emplace_back
(
std
::
vector
<
unsigned
int
>
(
1
,
currentRun
)
)
;
runs
.
emplace_back
(
1
,
currentRun
);
else
else
runs
.
front
().
emplace_back
(
currentRun
);
runs
.
front
().
emplace_back
(
currentRun
);
}
else
{
}
else
{
runs
.
emplace_back
(
std
::
vector
<
unsigned
int
>
(
1
,
currentRun
)
)
;
runs
.
emplace_back
(
1
,
currentRun
);
}
}
currentRun
+=
stepSize
;
currentRun
+=
stepSize
;
...
@@ -596,11 +592,11 @@ generateRange(unsigned int const from, unsigned int const to,
...
@@ -596,11 +592,11 @@ generateRange(unsigned int const from, unsigned int const to,
while
(
currentRun
>=
to
)
{
while
(
currentRun
>=
to
)
{
if
(
addRuns
)
{
if
(
addRuns
)
{
if
(
runs
.
empty
())
if
(
runs
.
empty
())
runs
.
emplace_back
(
std
::
vector
<
unsigned
int
>
(
1
,
currentRun
)
)
;
runs
.
emplace_back
(
1
,
currentRun
);
else
else
runs
.
front
().
emplace_back
(
currentRun
);
runs
.
front
().
emplace_back
(
currentRun
);
}
else
{
}
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
// Guard against case where stepSize would take us into negative
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment