STYLE: simplify short-circuit involving autoPtr (#1775)
- with '&&' conditions, often better to check for non-null autoPtr
first (it is cheap)
- check as bool instead of valid() method for cleaner code, especially
when the wrapped item itself has a valid/empty or good.
Also when handling multiple checks.
Now
if (ptr && ptr->valid())
if (ptr1 || ptr2)
instead
if (ptr.valid() && ptr->valid())
if (ptr1.valid() || ptr2.valid())
This commit is contained in:
@ -969,7 +969,7 @@ void Foam::shortestPathSet::genSamples
|
||||
markLeakPath,
|
||||
iter,
|
||||
mesh,
|
||||
(isBlockedFace.valid() ? isBlockedFace() : isBoundaryFace),
|
||||
(isBlockedFace ? *isBlockedFace : isBoundaryFace),
|
||||
insidePoint,
|
||||
insideCelli,
|
||||
outsidePoint,
|
||||
|
||||
Reference in New Issue
Block a user