belingueres commented on a change in pull request #39: [MRESOLVER-93] - PathRecordingDependencyVisitor to handle 3 cycles URL: https://github.com/apache/maven-resolver/pull/39#discussion_r315972295
########## File path: maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitor.java ########## @@ -101,6 +96,7 @@ public boolean visitEnter( DependencyNode node ) { boolean accept = filter == null || filter.accept( node, parents ); + boolean hasDuplicateNodeInParent = parents.contains( node ); Review comment: If parent.contains(node) performance is a problem, you could maintain both the Stack and IdentityHasMap to store the nodes, and replace the parent.contains(node) with visited.containsKey(node) which is an O(1) operation. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services