mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use autoPtr::New and tmp::New for simple return types
This commit is contained in:
@ -49,7 +49,7 @@ Foam::tmp<Foam::Field<Type>> Foam::readParticleField
|
||||
if (obj != nullptr)
|
||||
{
|
||||
IOField<Type> newField(*obj);
|
||||
return tmp<Field<Type>>(new Field<Type>(newField.xfer()));
|
||||
return tmp<Field<Type>>::New(newField.xfer());
|
||||
}
|
||||
|
||||
FatalErrorInFunction
|
||||
|
||||
@ -55,22 +55,19 @@ autoPtr<GeoFieldType> loadField
|
||||
Info<< "Reading " << GeoFieldType::typeName
|
||||
<< ' ' << io->name() << endl;
|
||||
|
||||
return autoPtr<GeoFieldType>
|
||||
return autoPtr<GeoFieldType>::New
|
||||
(
|
||||
new GeoFieldType
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
io->name(),
|
||||
io->instance(),
|
||||
io->local(),
|
||||
io->db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE,
|
||||
io->registerObject()
|
||||
),
|
||||
mesh
|
||||
)
|
||||
io->name(),
|
||||
io->instance(),
|
||||
io->local(),
|
||||
io->db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE,
|
||||
io->registerObject()
|
||||
),
|
||||
mesh
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user