mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: for-range, forAllIters() ... in applications/utilities
- reduced clutter when iterating over containers
This commit is contained in:
@ -201,18 +201,10 @@ int main(int argc, char *argv[])
|
||||
forAll(surface1.patches(), i)
|
||||
{
|
||||
const word& name = surface1.patches()[i].name();
|
||||
auto iter = nameToPatch.find(name);
|
||||
|
||||
label combinedi;
|
||||
if (iter.found())
|
||||
{
|
||||
combinedi = iter.object();
|
||||
}
|
||||
else
|
||||
{
|
||||
combinedi = nameToPatch.size();
|
||||
nameToPatch.insert(name, combinedi);
|
||||
}
|
||||
// Lookup or insert
|
||||
const label combinedi = nameToPatch(name, nameToPatch.size());
|
||||
|
||||
patch1Map[i] = combinedi;
|
||||
}
|
||||
|
||||
@ -221,18 +213,10 @@ int main(int argc, char *argv[])
|
||||
forAll(surface2.patches(), i)
|
||||
{
|
||||
const word& name = surface2.patches()[i].name();
|
||||
auto iter = nameToPatch.find(name);
|
||||
|
||||
label combinedi;
|
||||
if (iter.found())
|
||||
{
|
||||
combinedi = iter.object();
|
||||
}
|
||||
else
|
||||
{
|
||||
combinedi = nameToPatch.size();
|
||||
nameToPatch.insert(name, combinedi);
|
||||
}
|
||||
// Lookup or insert
|
||||
const label combinedi = nameToPatch(name, nameToPatch.size());
|
||||
|
||||
patch2Map[i] = combinedi;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user