Skip to content

Commit

Permalink
Use one method to figure out of the position has been chached or not.
Browse files Browse the repository at this point in the history
  • Loading branch information
JervenBolleman committed Mar 15, 2024
1 parent ef4515a commit a71a686
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@ public String getNamespace() {

@Override
public String getLocalName() {
PathGraph<P, S, ?, ?> pathGraph = graph.pathGraph();
S step = pathGraph.stepByRankAndPath(path, rank);
if (hasCachedPosition()) {
return Long.toString(pathGraph.beginPositionOfStep(step));
} else {
return Long.toString(position);
}
return Long.toString(getBeginPosition());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ public String getNamespace() {

@Override
public String getLocalName() {
PathGraph<P, S, ?, ?> pathGraph = graph.pathGraph();
S step = pathGraph.stepByRankAndPath(path, rank);
if (hasCachedPosition()) {
return Long.toString(position);
} else {
return Long.toString(pathGraph.endPositionOfStep(step));
}
return Long.toString(getEndPosition());
}

@Override
Expand Down

0 comments on commit a71a686

Please sign in to comment.