STYLE: prefer autoPtr::reset() to autoPtr::set()

- in most cases already checked valid() so don't need additional check
  for setting an existing pointer
This commit is contained in:
Mark Olesen
2017-11-22 19:11:11 +01:00
parent e96cbd9050
commit 416a3790ea
34 changed files with 141 additions and 124 deletions

View File

@ -231,7 +231,7 @@ Foam::autoPtr<Foam::triSurface> Foam::triSurfaceLoader::load
else if (selected_.size() == 1)
{
// Use scaling (if any)
output.set(new triSurface(directory_/selected_[0], scaleFactor));
output.reset(new triSurface(directory_/selected_[0], scaleFactor));
triSurface& surf = output();
@ -400,7 +400,7 @@ Foam::autoPtr<Foam::triSurface> Foam::triSurfaceLoader::load
points *= scaleFactor;
}
output.set(new triSurface(faces, patches, points, true));
output.reset(new triSurface(faces, patches, points, true));
return output;
}