perf: fix redundant addAll

This commit is contained in:
Breno A. 2024-06-09 09:43:31 -03:00
parent 33d5c5238a
commit 1424405c64
2 changed files with 2 additions and 4 deletions

View File

@ -29,8 +29,7 @@ public class KillMonsterTimeChallengeFactoryHandler implements ChallengeFactoryH
Scene scene,
SceneGroup group) {
val realGroup = scene.getScriptManager().getGroupById(groupId);
val challengeTriggers = new ArrayList<ChallengeTrigger>();
challengeTriggers.addAll(List.of(new KillMonsterCountTrigger(), new InTimeTrigger()));
val challengeTriggers = new ArrayList<>(List.of(new KillMonsterCountTrigger(), new InTimeTrigger()));
val challengeData = GameData.getDungeonChallengeConfigDataMap().get(challengeId);
val challengeType = challengeData.getChallengeType();

View File

@ -58,8 +58,7 @@ public class MailHandler extends BasePlayerManager {
}
public void deleteMail(List<Integer> mailList) {
List<Integer> sortedMailList = new ArrayList<>();
sortedMailList.addAll(mailList);
List<Integer> sortedMailList = new ArrayList<>(mailList);
sortedMailList.sort(Collections.reverseOrder());
List<Integer> deleted = new ArrayList<>();