Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ public void reset() {
// Instead of re-using the same visitedNodes instance and clear-ing it, profiling showed it
// to be more efficient to create a new instance.
// visitedNodes.clear();
visitedNodes = new IdentityHashMap<>();
if (!visitedNodes.isEmpty()) {
visitedNodes = new IdentityHashMap<>();
}
Comment on lines 174 to +179
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above reset() says profiling showed it is more efficient to create a new visitedNodes instance, but the new logic only does so when the map is non-empty. Please update the comment to reflect the conditional behavior (or adjust the code to match the comment), otherwise it becomes misleading for future maintainers.

Copilot uses AI. Check for mistakes.
}

/**
Expand Down
Loading