ENH: List/DynamicList appendUniq() method

- affords some code reduction.

STYLE: use HashSet insert() without found() check in more places
This commit is contained in:
Mark Olesen
2021-04-06 12:29:26 +02:00
committed by Andrew Heather
parent 6dc6d7ca9a
commit cdbc3e2de6
36 changed files with 166 additions and 341 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2014 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -194,13 +194,9 @@ void Foam::meshToMeshMethod::appendNbrCells
// filter out cells already visited from cell neighbours
for (const label nbrCelli : nbrCells)
{
if
(
!visitedCells.found(nbrCelli)
&& !nbrCellIDs.found(nbrCelli)
)
if (!visitedCells.found(nbrCelli))
{
nbrCellIDs.append(nbrCelli);
nbrCellIDs.appendUniq(nbrCelli);
}
}
}