STYLE: use autoPtr::New and tmp::New for simple return types

This commit is contained in:
Mark Olesen
2018-02-26 14:00:30 +01:00
parent 52b36f84b5
commit 57291e8692
196 changed files with 555 additions and 879 deletions

View File

@ -41,7 +41,7 @@ Foam::sampledIsoSurfaceCell::sampleField
// Recreate geometry if time has changed
updateGeometry();
return tmp<Field<Type>>(new Field<Type>(vField, meshCells_));
return tmp<Field<Type>>::New(vField, meshCells_);
}

View File

@ -40,7 +40,7 @@ Foam::sampledIsoSurface::sampleField
// Recreate geometry if time has changed
updateGeometry();
return tmp<Field<Type>>(new Field<Type>(vField, surface().meshCells()));
return tmp<Field<Type>>::New(vField, surface().meshCells());
}

View File

@ -37,7 +37,7 @@ Foam::sampledCuttingPlane::sampleField
const GeometricField<Type, fvPatchField, volMesh>& vField
) const
{
return tmp<Field<Type>>(new Field<Type>(vField, surface().meshCells()));
return tmp<Field<Type>>::New(vField, surface().meshCells());
}

View File

@ -34,7 +34,7 @@ Foam::sampledPlane::sampleField
const GeometricField<Type, fvPatchField, volMesh>& vField
) const
{
return tmp<Field<Type>>(new Field<Type>(vField, meshCells()));
return tmp<Field<Type>>::New(vField, meshCells());
}

View File

@ -42,7 +42,7 @@ Foam::sampledThresholdCellFaces::sampleField
// Recreate geometry if time has changed
updateGeometry();
return tmp<Field<Type>>(new Field<Type>(vField, meshCells_));
return tmp<Field<Type>>::New(vField, meshCells_);
}

View File

@ -36,7 +36,7 @@ Foam::tmp<Foam::Field<Type>> Foam::cuttingPlane::sample
const Field<Type>& fld
) const
{
return tmp<Field<Type>>(new Field<Type>(fld, meshCells()));
return tmp<Field<Type>>::New(fld, meshCells());
}