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:
@ -521,7 +521,7 @@ bool Foam::functionObjects::vtkWrite::write()
|
||||
|
||||
// CellData
|
||||
{
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
// Optionally with cellID and procID fields
|
||||
internalWriter->beginCellData
|
||||
@ -580,7 +580,7 @@ bool Foam::functionObjects::vtkWrite::write()
|
||||
if (interpolate_)
|
||||
{
|
||||
// Begin PointData
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->beginPointData
|
||||
(
|
||||
@ -631,7 +631,7 @@ bool Foam::functionObjects::vtkWrite::write()
|
||||
|
||||
|
||||
// Finish writers
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->close();
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ Foam::label Foam::functionObjects::vtkWrite::writeVolFields
|
||||
const auto& field = tfield();
|
||||
|
||||
// Internal
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
ok = true;
|
||||
internalWriter->write(field);
|
||||
|
||||
Reference in New Issue
Block a user