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:
Mark Olesen
2020-07-15 08:50:57 +02:00
parent 9af3f85cf9
commit 12c91b9472
144 changed files with 483 additions and 470 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -153,7 +153,7 @@ Description
// Finish writers
if (internalWriter.valid())
if (internalWriter)
{
internalWriter->close();
}

View File

@ -262,7 +262,7 @@ Description
// CellData
{
// Begin CellData
if (internalWriter.valid())
if (internalWriter)
{
// Optionally with cellID and procID fields
internalWriter->beginCellData
@ -323,7 +323,7 @@ Description
if (doPointValues)
{
// Begin PointData
if (internalWriter.valid())
if (internalWriter)
{
internalWriter->beginPointData
(
@ -386,7 +386,7 @@ Description
// Finish writers
if (internalWriter.valid())
if (internalWriter)
{
internalWriter->close();
}

View File

@ -60,7 +60,7 @@ bool writeDimField
const auto& field = tfield();
if (internalWriter.valid())
if (internalWriter)
{
internalWriter->write(field);
}

View File

@ -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.
@ -83,7 +83,7 @@ bool writePointField
const auto& field = tproxied();
// Internal
if (internalWriter.valid())
if (internalWriter)
{
internalWriter->write(field);
}

View File

@ -63,7 +63,7 @@ bool writeVolField
const auto& field = tfield();
// Internal
if (internalWriter.valid())
if (internalWriter)
{
internalWriter->write(field);
}