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:
@ -93,14 +93,10 @@ Foam::cellSizeAndAlignmentControls::cellSizeAndAlignmentControls
|
||||
{
|
||||
label functionI = 0;
|
||||
|
||||
forAllConstIter(dictionary, shapeControlDict_, iter)
|
||||
for (const entry& dEntry : shapeControlDict_)
|
||||
{
|
||||
word shapeControlEntryName = iter().keyword();
|
||||
|
||||
const dictionary& controlFunctionDict
|
||||
(
|
||||
shapeControlDict_.subDict(shapeControlEntryName)
|
||||
);
|
||||
const word& shapeControlEntryName = dEntry.keyword();
|
||||
const dictionary& controlFunctionDict = dEntry.dict();
|
||||
|
||||
Info<< nl << "Shape Control : " << shapeControlEntryName << endl;
|
||||
Info<< incrIndent;
|
||||
|
||||
@ -535,16 +535,12 @@ Foam::conformationSurfaces::conformationSurfaces
|
||||
Info<< nl << "Reading additionalFeatures" << endl;
|
||||
}
|
||||
|
||||
forAllConstIter(dictionary, additionalFeaturesDict, iter)
|
||||
for (const entry& dEntry : additionalFeaturesDict)
|
||||
{
|
||||
word featureName = iter().keyword();
|
||||
const word& featureName = dEntry.keyword();
|
||||
const dictionary& featureSubDict = dEntry.dict();
|
||||
|
||||
Info<< nl << " " << iter().keyword() << endl;
|
||||
|
||||
const dictionary& featureSubDict
|
||||
(
|
||||
additionalFeaturesDict.subDict(featureName)
|
||||
);
|
||||
Info<< nl << " " << featureName << endl;
|
||||
|
||||
readFeatures(featureSubDict, featureName, featureI);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user