Skip to content

Commit

Permalink
Use streams instead of LinkedHashset
Browse files Browse the repository at this point in the history
  • Loading branch information
sridamul committed Jul 19, 2024
1 parent 005f45d commit 35e1216
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import java.net.URL;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
Expand Down Expand Up @@ -124,8 +123,9 @@ private List<String> loadPlugins() {
loadedPlugins.addAll(plugins);
}

Set<String> uniquePlugins = new LinkedHashSet<>(loadedPlugins);
return new ArrayList<>(uniquePlugins);
return loadedPlugins.stream()
.distinct()
.collect(Collectors.toCollection(ArrayList::new));
}

@Override
Expand Down

0 comments on commit 35e1216

Please sign in to comment.