Skip to content
Snippets Groups Projects
Commit fcd8d71e authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: ensightCells, ensightFaces sub-lists are always allocated

- remove remnant nullptr check
parent a2bba390
No related merge requests found
......@@ -191,10 +191,7 @@ void Foam::ensightCells::sort()
{
forAll(lists_, typeI)
{
if (lists_[typeI])
{
Foam::sort(*(lists_[typeI]));
}
Foam::sort(*(lists_[typeI]));
}
}
......
......@@ -233,28 +233,25 @@ void Foam::ensightFaces::sort()
{
if (flipMap_.size() == address_.size())
{
// sort flip too
// sort flip map too
labelList order;
label start = 0;
forAll(lists_, typeI)
{
if (lists_[typeI])
{
SubList<label>& idLst = *(lists_[typeI]);
const label sz = idLst.size();
SubList<label>& idLst = *(lists_[typeI]);
const label sz = idLst.size();
if (sz)
{
SubList<bool> flip(flipMap_, sz, start);
start += sz; // for next sub-list
if (sz)
{
SubList<bool> flip(flipMap_, sz, start);
start += sz; // for next sub-list
sortedOrder(idLst, order);
Foam::sortedOrder(idLst, order);
idLst = reorder<labelList>(order, idLst);
flip = reorder<boolList>(order, flip);
}
idLst = reorder<labelList>(order, idLst);
flip = reorder<boolList>(order, flip);
}
}
}
......@@ -263,16 +260,9 @@ void Foam::ensightFaces::sort()
// no flip-maps, simpler to sort
forAll(lists_, typeI)
{
if (lists_[typeI])
{
SubList<label>& idLst = *(lists_[typeI]);
const label sz = idLst.size();
if (sz)
{
Foam::sort(idLst);
}
}
Foam::sort(*(lists_[typeI]));
}
flipMap_.clear(); // for safety
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment