Skip to content

Commit

Permalink
Skip duplicate urls
Browse files Browse the repository at this point in the history
Forge loves to add these. Minor speedup.
  • Loading branch information
makamys committed Dec 18, 2023
1 parent 2643e5b commit f5cc3e0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

Expand All @@ -39,7 +40,7 @@ public class PrefixedClasspathResourceAccelerator {
private void init() {
long t0 = System.nanoTime();
classSources = new ArrayList<>();
for(URL url : Launch.classLoader.getSources()) {
for(URL url : Launch.classLoader.getSources().stream().distinct().collect(Collectors.toList())) {
try {
classSources.add(Index.fromURL(url));
} catch(Exception e) {
Expand Down

0 comments on commit f5cc3e0

Please sign in to comment.