Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhom1314 committed Sep 26, 2024
1 parent 73ea942 commit af4ac60
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import static java.util.stream.Collectors.toList;

Expand Down Expand Up @@ -57,6 +58,10 @@ public List<TaskWrapper> getByNames(Set<String> names) {
}

public static void register(TaskWrapper taskWrapper) {
Set<String> names = TASK_WRAPPERS.stream().map(TaskWrapper::name).collect(Collectors.toSet());
if (names.contains(taskWrapper.name())) {
return;
}
TASK_WRAPPERS.add(taskWrapper);
}

Expand Down

0 comments on commit af4ac60

Please sign in to comment.