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:
@ -39,16 +39,16 @@ Foam::autoPtr<Foam::meshToMeshMethod> Foam::meshToMeshMethod::New
|
||||
Info<< "Selecting AMIMethod " << methodName << endl;
|
||||
}
|
||||
|
||||
componentsConstructorTable::iterator cstrIter =
|
||||
componentsConstructorTablePtr_->find(methodName);
|
||||
auto cstrIter = componentsConstructorTablePtr_->cfind(methodName);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown meshToMesh type "
|
||||
<< methodName << nl << nl
|
||||
<< "Valid meshToMesh types are:" << nl
|
||||
<< componentsConstructorTablePtr_->sortedToc() << exit(FatalError);
|
||||
<< "Valid meshToMesh types :" << nl
|
||||
<< componentsConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<meshToMeshMethod>(cstrIter()(src, tgt));
|
||||
|
||||
@ -448,8 +448,7 @@ Foam::autoPtr<Foam::sampledSet> Foam::sampledSet::New
|
||||
{
|
||||
const word sampleType(dict.lookup("type"));
|
||||
|
||||
wordConstructorTable::iterator cstrIter =
|
||||
wordConstructorTablePtr_->find(sampleType);
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(sampleType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
|
||||
@ -33,8 +33,7 @@ Foam::autoPtr<Foam::surfaceReader> Foam::surfaceReader::New
|
||||
const fileName& fName
|
||||
)
|
||||
{
|
||||
fileNameConstructorTable::iterator cstrIter =
|
||||
fileNameConstructorTablePtr_->find(readerType);
|
||||
auto cstrIter = fileNameConstructorTablePtr_->cfind(readerType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
|
||||
@ -61,15 +61,14 @@ Foam::autoPtr<Foam::sampledSurface> Foam::sampledSurface::New
|
||||
Info<< "Selecting sampledType " << sampleType << endl;
|
||||
}
|
||||
|
||||
wordConstructorTable::iterator cstrIter =
|
||||
wordConstructorTablePtr_->find(sampleType);
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(sampleType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown sample type "
|
||||
<< sampleType << nl << nl
|
||||
<< "Valid sample types : " << endl
|
||||
<< "Valid sample types :" << endl
|
||||
<< wordConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -54,8 +54,7 @@ namespace Foam
|
||||
Foam::autoPtr<Foam::surfaceWriter>
|
||||
Foam::surfaceWriter::New(const word& writeType)
|
||||
{
|
||||
wordConstructorTable::iterator cstrIter =
|
||||
wordConstructorTablePtr_->find(writeType);
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(writeType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
@ -86,8 +85,7 @@ Foam::autoPtr<Foam::surfaceWriter>
|
||||
Foam::surfaceWriter::New(const word& writeType, const dictionary& optDict)
|
||||
{
|
||||
// find constructors with dictionary options
|
||||
wordDictConstructorTable::iterator cstrIter =
|
||||
wordDictConstructorTablePtr_->find(writeType);
|
||||
auto cstrIter = wordDictConstructorTablePtr_->cfind(writeType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
|
||||
@ -78,8 +78,7 @@ Foam::surfMeshSampler::New
|
||||
{
|
||||
const word sampleType(dict.lookup("type"));
|
||||
|
||||
wordConstructorTable::iterator cstrIter =
|
||||
wordConstructorTablePtr_->find(sampleType);
|
||||
auto cstrIter = wordConstructorTablePtr_->cfind(sampleType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user