mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: check autoPtr as plain bool instead of valid()
- cleaner code, more similarity with unique_ptr
Now
if (ptr)
if (!ptr)
instead
if (ptr.valid())
if (!ptr.valid())
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -146,7 +146,7 @@ bool Foam::functionObjects::ensightWrite::update()
|
||||
// ensMesh_.clear();
|
||||
// meshSubset_.clear();
|
||||
// }
|
||||
// else if (ensMesh_.valid())
|
||||
// else if (ensMesh_)
|
||||
// {
|
||||
// ensMesh_->expire();
|
||||
// }
|
||||
@ -157,13 +157,13 @@ bool Foam::functionObjects::ensightWrite::update()
|
||||
|
||||
meshState_ = polyMesh::UNCHANGED;
|
||||
|
||||
if (!ensMesh_.valid())
|
||||
if (!ensMesh_)
|
||||
{
|
||||
ensMesh_.reset(new ensightMesh(meshSubset_.mesh(), writeOpts_));
|
||||
}
|
||||
else if (ensMesh_().needsUpdate())
|
||||
else if (ensMesh_->needsUpdate())
|
||||
{
|
||||
ensMesh_().correct();
|
||||
ensMesh_->correct();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user