mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use auto and cfind to simplify selector usage (issue #512)
This commit is contained in:
@ -43,15 +43,14 @@ Foam::functionObjects::fieldValue::New
|
||||
Info<< "Selecting " << typeName << " " << modelType << endl;
|
||||
}
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown " << typeName << " type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid " << typeName << " types are:" << nl
|
||||
<< "Valid " << typeName << " types :" << nl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -183,15 +183,14 @@ Foam::functionObjects::runTimePostPro::pathline::New
|
||||
Info<< "Selecting pathline " << pathlineType << endl;
|
||||
}
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(pathlineType);
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(pathlineType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown pathline type "
|
||||
<< pathlineType << nl << nl
|
||||
<< "Valid pathline types are:" << endl
|
||||
<< "Valid pathline types :" << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -143,15 +143,14 @@ Foam::autoPtr<Foam::functionObjects::runTimePostPro::pointData> Foam::functionOb
|
||||
Info<< "Selecting pointData " << pointDataType << endl;
|
||||
}
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(pointDataType);
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(pointDataType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown pointData type "
|
||||
<< pointDataType << nl << nl
|
||||
<< "Valid pointData types are:" << endl
|
||||
<< "Valid pointData types :" << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -209,15 +209,14 @@ Foam::functionObjects::runTimePostPro::surface::New
|
||||
Info<< "Selecting surface " << surfaceType << endl;
|
||||
}
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(surfaceType);
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(surfaceType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown surface type "
|
||||
<< surfaceType << nl << nl
|
||||
<< "Valid surface types are:" << endl
|
||||
<< "Valid surface types :" << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -36,19 +36,18 @@ Foam::functionObjects::runTimeControls::runTimeCondition::New
|
||||
stateFunctionObject& state
|
||||
)
|
||||
{
|
||||
word conditionType(dict.lookup("type"));
|
||||
const word conditionType(dict.lookup("type"));
|
||||
|
||||
Info<< "Selecting runTimeCondition " << conditionType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(conditionType);
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(conditionType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown runTimeCondition type "
|
||||
<< conditionType << nl << nl
|
||||
<< "Valid runTimeCondition types are:" << nl
|
||||
<< "Valid runTimeCondition types :" << nl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user