STYLE: use direct iteration for HashSet

- The iterator for a HashSet dereferences directly to its key.

- Eg,

      for (const label patchi : patchSet)
      {
          ...
      }
  vs.
      forAllConstIter(labelHashSet, patchSet, iter)
      {
          const label patchi = iter.key();
          ...
      }
This commit is contained in:
Mark Olesen
2018-03-06 00:29:03 +01:00
parent 2a6ac7edce
commit 4fe8ed8245
73 changed files with 475 additions and 602 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,9 +60,9 @@ void Foam::patchCloudSet::calcSamples
// Construct search tree for all patch faces.
label sz = 0;
forAllConstIter(labelHashSet, patchSet_, iter)
for (const label patchi : patchSet_)
{
const polyPatch& pp = mesh().boundaryMesh()[iter.key()];
const polyPatch& pp = mesh().boundaryMesh()[patchi];
sz += pp.size();
@ -75,9 +75,9 @@ void Foam::patchCloudSet::calcSamples
labelList patchFaces(sz);
sz = 0;
treeBoundBox bb(boundBox::invertedBox);
forAllConstIter(labelHashSet, patchSet_, iter)
for (const label patchi : patchSet_)
{
const polyPatch& pp = mesh().boundaryMesh()[iter.key()];
const polyPatch& pp = mesh().boundaryMesh()[patchi];
forAll(pp, i)
{