Skip to content

isValid should use ==-1 to allow other special values #1666

Closed

Description

@karussell

#1665

Also use isValid where currently ==-1 is used.

Activity

  1. easbar commented on Jul 17, 2019

    @easbar
    Member

    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

  2. karussell commented on Jul 18, 2019

    @karussell
    MemberAuthor

    Ok, makes sense. No need to change isValid or should we explicitly use edgeId >= 0; instead of using NO_EDGE?

  3. easbar commented on Jul 19, 2019

    @easbar
    Member

    or should we explicitly use edgeId >= 0

    yes I think this is a good idea, and I will add some documentation as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions