STYLE: use auto and cfind to simplify selector usage (issue #512)
This commit is contained in:
@ -33,15 +33,14 @@ Foam::autoPtr<Foam::noiseModel> Foam::noiseModel::New(const dictionary& dict)
|
||||
|
||||
Info<< "Selecting noiseModel " << modelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown noiseModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid noiseModel types are:" << nl
|
||||
<< "Valid noiseModel types :" << nl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -37,15 +37,14 @@ Foam::autoPtr<Foam::windowModel> Foam::windowModel::New
|
||||
|
||||
Info<< "Selecting windowModel " << modelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown windowModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid windowModel types are:" << nl
|
||||
<< "Valid windowModel types :" << nl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user