michael-o commented on a change in pull request #530:
URL: https://github.com/apache/maven/pull/530#discussion_r716543177
##########
File path:
maven-core/src/main/java/org/apache/maven/graph/DefaultProjectDependencyGraph.java
##########
@@ -59,6 +66,16 @@ public DefaultProjectDependencyGraph(
Collection<MavenProject> projects )
super();
this.allProjects = Collections.unmodifiableList( new ArrayList<>(
projects ) );
this.sorter = new ProjectSorter( projects );
+ this.order = new HashMap<>();
+ this.projects = new HashMap<>();
+ List<MavenProject> sorted = this.sorter.getSortedProjects();
+ for ( int index = 0; index < sorted.size(); index++ )
+ {
+ MavenProject project = sorted.get( index );
Review comment:
This should rather use an iterator style (for each loop) and a
separately incremended index. Generally, this will incur `O(n)` and is
antipattern.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]