Skip to content

Commit

Permalink
fix: vertex and edge iterators with no filters, do not go through the…
Browse files Browse the repository at this point in the history
… while linked list of edges

Fixed issue #1626
  • Loading branch information
lvca committed Jun 8, 2024
1 parent d272bc4 commit 09d1b9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions engine/src/main/java/com/arcadedb/graph/EdgeIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ public boolean hasNext() {
if (currentContainer == null)
return false;

if (currentPosition.get() < currentContainer.getUsed())
return true;
while (true) {
if (currentPosition.get() < currentContainer.getUsed())
return true;

currentContainer = currentContainer.getPrevious();
if (currentContainer == null)
break;

currentContainer = currentContainer.getPrevious();
if (currentContainer != null) {
currentPosition.set(MutableEdgeSegment.CONTENT_START_POSITION);
return currentPosition.get() < currentContainer.getUsed();
}

return false;
}

Expand Down
13 changes: 8 additions & 5 deletions engine/src/main/java/com/arcadedb/graph/VertexIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ public boolean hasNext() {
if (currentContainer == null)
return false;

if (currentPosition.get() < currentContainer.getUsed())
return true;
while (true) {
if (currentPosition.get() < currentContainer.getUsed())
return true;

currentContainer = currentContainer.getPrevious();
if (currentContainer == null)
break;

currentContainer = currentContainer.getPrevious();
if (currentContainer != null) {
currentPosition.set(MutableEdgeSegment.CONTENT_START_POSITION);
return currentPosition.get() < currentContainer.getUsed();
}

return false;
}

Expand Down

0 comments on commit 09d1b9e

Please sign in to comment.