STYLE: replace uses of autoPtr::empty() with bool check (#1775)

- less clutter using plain tests with the bool operator:

      (!ptr)  vs  (ptr.empty())
      (ptr)   vs  (!ptr.empty())
This commit is contained in:
Mark Olesen
2020-07-15 10:47:53 +02:00
parent 53eda1c4f1
commit 3baebcb101
45 changed files with 135 additions and 141 deletions

View File

@ -91,7 +91,7 @@ Foam::pointHistory::pointHistory
refHistoryPoint_(dict.lookup("refHistoryPoint")),
processor_(-1),
fileName_(dict.get<word>("fileName")),
historyFilePtr_()
historyFilePtr_(nullptr)
{
Info<< "Creating " << this->name() << " function object." << endl;
@ -144,7 +144,7 @@ Foam::pointHistory::pointHistory
}
// Create history file if not already created
if (historyFilePtr_.empty())
if (!historyFilePtr_)
{
// File update
if (Pstream::master())
@ -180,13 +180,11 @@ Foam::pointHistory::pointHistory
);
// Add headers to output data
if (historyFilePtr_.valid())
if (historyFilePtr_)
{
historyFilePtr_()
<< "# Time" << tab << "X" << tab
<< "Y" << tab << "Z";
historyFilePtr_() << endl;
<< "# Time" << tab << "X" << tab << "Y" << tab << "Z"
<< endl;
}
}
}