mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
committed by
Andrew Heather
parent
0800e021ad
commit
078e34746e
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user