STYLE: use auto and cfind to simplify selector usage (issue #512)

This commit is contained in:
Mark Olesen
2017-07-03 10:36:03 +02:00
parent a09815fae2
commit bc1f2fa97e
246 changed files with 1109 additions and 1481 deletions

View File

@ -180,19 +180,18 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
const dictionary& decompositionDict
)
{
word methodType(decompositionDict.lookup("method"));
const word methodType(decompositionDict.lookup("method"));
Info<< "Selecting decompositionMethod " << methodType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(methodType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(methodType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown decompositionMethod "
<< methodType << nl << nl
<< "Valid decompositionMethods are : " << endl
<< "Valid decompositionMethods : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}