ENH: for-range, forAllIters() ... in applications/utilities

- reduced clutter when iterating over containers
This commit is contained in:
Mark Olesen
2019-01-07 09:20:51 +01:00
parent 1458b4f689
commit 14a404170b
76 changed files with 592 additions and 728 deletions

View File

@ -107,23 +107,23 @@ HashTable<wordList> extractPatchGroups(const dictionary& boundaryDict)
const word& patchName = dEntry.keyword();
const dictionary& patchDict = dEntry.dict();
wordList groups;
if (patchDict.readIfPresent("inGroups", groups))
wordList groupNames;
patchDict.readIfPresent("inGroups", groupNames);
for (const word& groupName : groupNames)
{
forAll(groups, i)
auto groupIter = groupToPatch.find(groupName);
if (groupIter.found())
{
auto fndGroup = groupToPatch.find(groups[i]);
if (!fndGroup.found())
{
groupToPatch.insert(groups[i], wordList(1, patchName));
}
else
{
fndGroup().append(patchName);
}
(*groupIter).append(patchName);
}
else
{
groupToPatch.insert(groupName, wordList(one(), patchName));
}
}
}
return groupToPatch;
}