Skip to content

Reduce usages of DefaultEdgeFilter(encoder, true, false) #1380

Closed

Description

@easbar

We often do something like

graph.createEdgeExplorer(new DefaultEdgeFilter(encoder, false, true));

(about 35 times in the current master). I've done this myself quite a few times and everytime I need to check if I got the flags right. Therefore I would suggest to add two or three static factory methods to DefaultEdgeFilter: DefaultEdgeFilter.inEdges(FlagEncoder), DefaultEdgeFilter.outEdges(FlagEncoder) and optionally DefaultEdgeFilter.allEdges(FlagEncoder). The last one is what the default constructor does, but would be more readable in my opinion.

Activity

  1. karussell commented on May 27, 2018

    @karussell
    Member

    Yes, please - this is a good idea. This would also solve the ugliness in #1112 where I swapped the booleans (as fwd,bwd is more intuitive) but this would brake all usages without being noticed.

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