Skip to content

Commit

Permalink
refactor: use EnumMap instead of HasMap due to performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
mamilic authored and Marko Milic committed Oct 21, 2024
1 parent 2da4296 commit e64ac43
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -78,7 +79,7 @@ public class PackageCommand {
private static final Map<NodeKind, BiFunction<PackageParams, IProgressMonitor, List<PackageNode>>> commands;

static {
commands = new HashMap<>();
commands = new EnumMap<>(NodeKind.class);
commands.put(NodeKind.PROJECT, PackageCommand::getProjectChildren);
commands.put(NodeKind.CONTAINER, PackageCommand::getContainerChildren);
commands.put(NodeKind.PACKAGEROOT, PackageCommand::getPackageRootChildren);
Expand Down

0 comments on commit e64ac43

Please sign in to comment.