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 | Copyright (C) 2015 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2015-2016 OpenFOAM Foundation
@ -79,11 +79,12 @@ public:
weights_(weights),
hasUnmapped_(false)
{
forAll(addressing_, i)
for (const labelList& addr : addressing)
{
if (addressing_[i].size() == 0)
if (addr.empty())
{
hasUnmapped_ = true;
break;
}
}
@ -99,8 +100,7 @@ public:
}
//- Destructor
virtual ~distributedWeightedFvPatchFieldMapper()
{}
virtual ~distributedWeightedFvPatchFieldMapper() = default;
// Member Functions