if(loadFactor != null && !(trialExists(loadFactor))
and
if(!(loadFactor == null || trialExists(loadFactor))
I was asked in the review to make the 1st, if I change to the 2nd. How does it matter.
There is no difference.
In both cases:
loadFactor
trialExists(loadFactor)
if
This is due to the fact that both &&are ||short-circuited:
&&
||
false
true
. : " , ". , " ", , , .
, De Morgan , Java.
"not (A B)" "( A) ( B)""not (A B)" "( A) ( B)"
"not (A B)" "( A) ( B)"
( )
, :
loadFactor != null && !(trialExists(loadFactor)
:
!!(loadFactor != null && !(tiralExists(loadFactor))
( (A B) ( A) ( B))
!(!(loadFactor != null) || !!(trialExists(loadFactor)))
!(loadFactor == null || trialExists(loadFactor))
2- .
. , loadFactor Null , , .
, , loadFactor Null.
, . && secnnd arg, , || second-arg, arg .
, , , .
, , trialExists() .