ENH: code adjustments for updated NullObject

- can now safely use labelList::null() instead of emptyLabelList for
  return values. No special treatment required for lists.

  Possible replacements:

      if (notNull(list) && list.size())  ->  if (list.size())
      if (isNull(list) || list.empty())  ->  if (list.empty())

  The receiver may still wish to handle differently to distinguish
  between a null list and an empty list, but no additional special
  protection is required when obtaining sizes, traversing, outputting
  etc.
This commit is contained in:
Mark Olesen
2019-02-07 13:04:24 +01:00
committed by Andrew Heather
parent 0800e021ad
commit 078e34746e
30 changed files with 84 additions and 117 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
@ -66,22 +66,12 @@ public:
:
directAddressing_(directAddressing),
distMap_(distMap),
hasUnmapped_(false)
{
if
(
notNull(directAddressing_)
&& directAddressing_.size()
&& min(directAddressing_) < 0
)
{
hasUnmapped_ = true;
}
}
hasUnmapped_(directAddressing_.size() && min(directAddressing_) < 0)
{}
//- Destructor
virtual ~distributedUnallocatedDirectFieldMapper()
{}
virtual ~distributedUnallocatedDirectFieldMapper() = default;
// Member Functions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015 OpenFOAM Foundation
@ -68,22 +68,12 @@ public:
:
directAddressing_(directAddressing),
distMap_(distMap),
hasUnmapped_(false)
{
if
(
notNull(directAddressing_)
&& directAddressing_.size()
&& min(directAddressing_) < 0
)
{
hasUnmapped_ = true;
}
}
hasUnmapped_(directAddressing_.size() && min(directAddressing_) < 0)
{}
//- Destructor
virtual ~distributedUnallocatedDirectFvPatchFieldMapper()
{}
virtual ~distributedUnallocatedDirectFvPatchFieldMapper() = default;
// Member Functions