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:
@ -1601,7 +1601,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
||||
"distributedTriSurfaceMesh::independentlyDistributedBbs"
|
||||
);
|
||||
|
||||
if (!decomposer_.valid())
|
||||
if (!decomposer_)
|
||||
{
|
||||
// Use singleton decomposeParDict. Cannot use decompositionModel
|
||||
// here since we've only got Time and not a mesh.
|
||||
@ -1619,7 +1619,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!decomposeParDict_.valid())
|
||||
if (!decomposeParDict_)
|
||||
{
|
||||
decomposeParDict_.reset
|
||||
(
|
||||
@ -1637,7 +1637,7 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
||||
)
|
||||
);
|
||||
}
|
||||
decomposer_ = decompositionMethod::New(decomposeParDict_());
|
||||
decomposer_ = decompositionMethod::New(*decomposeParDict_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2756,7 +2756,7 @@ void Foam::distributedTriSurfaceMesh::clearOut()
|
||||
|
||||
const Foam::globalIndex& Foam::distributedTriSurfaceMesh::globalTris() const
|
||||
{
|
||||
if (!globalTris_.valid())
|
||||
if (!globalTris_)
|
||||
{
|
||||
globalTris_.reset(new globalIndex(triSurface::size()));
|
||||
}
|
||||
|
||||
@ -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.
|
||||
@ -46,7 +46,7 @@ namespace patchDistMethods
|
||||
const Foam::distributedTriSurfaceMesh&
|
||||
Foam::patchDistMethods::exact::patchSurface() const
|
||||
{
|
||||
if (!patchSurfPtr_.valid())
|
||||
if (!patchSurfPtr_)
|
||||
{
|
||||
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user