Skip to content
Snippets Groups Projects
Commit 15fea54f authored by Mattijs Janssens's avatar Mattijs Janssens
Browse files

constant not present

parent 65b79dc7
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,7 @@ instantList Time::findTimes(const fileName& directory)
label nTimes = 0;
// Check for "constant"
bool haveConstant = false;
forAll(dirEntries, i)
{
if (dirEntries[i] == "constant")
......@@ -63,6 +64,7 @@ instantList Time::findTimes(const fileName& directory)
Times[nTimes].value() = 0;
Times[nTimes].name() = dirEntries[i];
nTimes++;
haveConstant = true;
break;
}
}
......@@ -84,9 +86,16 @@ instantList Time::findTimes(const fileName& directory)
// Reset the length of the times list
Times.setSize(nTimes);
if (nTimes > 1)
if (haveConstant)
{
std::sort(&Times[1], Times.end(), instant::less());
if (nTimes > 2)
{
std::sort(&Times[1], Times.end(), instant::less());
}
}
else if (nTimes > 1)
{
std::sort(&Times[0], Times.end(), instant::less());
}
return Times;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment