mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: direct iteration over dictionary entries
This commit is contained in:
@ -243,19 +243,18 @@ bool Foam::functionObjects::electricPotential::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
label phasei = 0;
|
||||
forAllConstIters(phasesDict_, iter)
|
||||
for (const entry& dEntry : phasesDict_)
|
||||
{
|
||||
const word& key = iter().keyword();
|
||||
const word& key = dEntry.keyword();
|
||||
|
||||
if (!phasesDict_.isDict(key))
|
||||
if (!dEntry.isDict())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Found non-dictionary entry " << iter()
|
||||
<< " in top-level dictionary " << phasesDict_
|
||||
<< exit(FatalError);
|
||||
FatalIOErrorInFunction(phasesDict_)
|
||||
<< "Entry " << key << " is not a dictionary" << nl
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
const dictionary& subDict = phasesDict_.subDict(key);
|
||||
const dictionary& subDict = dEntry.dict();
|
||||
|
||||
phaseNames_[phasei] = key;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user