Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
[change] Initialize the hash sets with the number of elements they ar…
Browse files Browse the repository at this point in the history
…e expected to hold (#339)
  • Loading branch information
odisseus authored Feb 7, 2023
1 parent 8ee2d67 commit 82bce85
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public Set<URI> filesByOutputGroupNameTransitive(String outputGroup) {
return Collections.emptySet();
}

var result = new HashSet<URI>();
var result = new HashSet<URI>(rootIds.size());
var toVisit = Queues.newArrayDeque(rootIds);
var visited = new HashSet<String>();
var visited = new HashSet<String>(rootIds.size());

while (!toVisit.isEmpty()) {
var fileSetId = toVisit.remove();
Expand Down

0 comments on commit 82bce85

Please sign in to comment.