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) 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();
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ bool writeDimField
|
||||
|
||||
const auto& field = tfield();
|
||||
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->write(field);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ bool writeVolField
|
||||
const auto& field = tfield();
|
||||
|
||||
// Internal
|
||||
if (internalWriter.valid())
|
||||
if (internalWriter)
|
||||
{
|
||||
internalWriter->write(field);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user