You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
isValid should use ==-1 to allow other special values #1666
Hmm I thought about this again and I think it makes sense that isValid checks if an edge id is >= 0, because valid edge ids simply are the ones that are >=0. If we only checked if an edge id is !=-1 it could be -2 for example, but we do not want to consider -2 'valid'.
I think it is more like everything >= 0 should still be considered valid and everything <0 'invalid', but there are different kinds of 'invalid' ? Like in #1665, where we have 'no edge' and 'any edge', they are both not valid to use as edge ids, but they are special values that are passed where usually an edge id is expected ? Maybe the only thing we may not do is to assume that if isValid==false the value has to be -1. Otherwise we can leave isValid as it is ?
I replaced some ==-1 comparisons with isValid here: #1667
Activity
easbar commentedon Jul 17, 2019
Hmm I thought about this again and I think it makes sense that
isValidchecks if an edge id is >= 0, because valid edge ids simply are the ones that are >=0. If we only checked if an edge id is!=-1it could be-2for example, but we do not want to consider-2'valid'.I think it is more like everything
>= 0should still be considered valid and everything<0'invalid', but there are different kinds of 'invalid' ? Like in #1665, where we have 'no edge' and 'any edge', they are both not valid to use as edge ids, but they are special values that are passed where usually an edge id is expected ? Maybe the only thing we may not do is to assume that ifisValid==falsethe value has to be -1. Otherwise we can leaveisValidas it is ?I replaced some
==-1comparisons withisValidhere: #1667karussell commentedon Jul 18, 2019
Ok, makes sense. No need to change isValid or should we explicitly use edgeId >= 0; instead of using NO_EDGE?
easbar commentedon Jul 19, 2019
yes I think this is a good idea, and I will add some documentation as well.