mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use range-for when looping dictionary entries.
- as part of the cleanup of dictionary access methods (c6520033c9)
made the dictionary class single inheritance from IDLList<entry>.
This eliminates any ambiguities for iterators and allows
for simple use of range-for looping.
Eg,
for (const entry& e : topDict))
{
Info<< "entry:" << e.keyword() << " is dict:" << e.isDict() << nl;
}
vs
forAllConstIter(dictionary, topDict, iter))
{
Info<< "entry:" << iter().keyword()
<< " is dict:" << iter().isDict() << nl;
}
This commit is contained in:
@ -154,9 +154,9 @@ Foam::word Foam::functionObjects::stateFunctionObject::objectResultType
|
||||
{
|
||||
const dictionary& objectDict = resultsDict.subDict(objectName);
|
||||
|
||||
forAllConstIter(dictionary, objectDict, iter)
|
||||
for (const entry& dEntry : objectDict)
|
||||
{
|
||||
const dictionary& dict = iter().dict();
|
||||
const dictionary& dict = dEntry.dict();
|
||||
|
||||
if (dict.found(entryName))
|
||||
{
|
||||
@ -195,9 +195,10 @@ objectResultEntries
|
||||
{
|
||||
const dictionary& objectDict = resultsDict.subDict(objectName);
|
||||
|
||||
forAllConstIter(dictionary, objectDict, iter)
|
||||
for (const entry& dEntry : objectDict)
|
||||
{
|
||||
const dictionary& dict = iter().dict();
|
||||
const dictionary& dict = dEntry.dict();
|
||||
|
||||
result.append(dict.toc());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user