From bb82e21c82021c4f1b5534505b01546f2269c45b Mon Sep 17 00:00:00 2001 From: "Breno A." Date: Sun, 9 Jun 2024 09:18:48 -0300 Subject: [PATCH] refactor: replace for loop with enhanced loop --- src/main/java/emu/grasscutter/utils/algorithms/KahnsSort.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/utils/algorithms/KahnsSort.java b/src/main/java/emu/grasscutter/utils/algorithms/KahnsSort.java index 1127ef9a4..5bb4b35fc 100644 --- a/src/main/java/emu/grasscutter/utils/algorithms/KahnsSort.java +++ b/src/main/java/emu/grasscutter/utils/algorithms/KahnsSort.java @@ -23,10 +23,10 @@ public class KahnsSort { mainList = new HashMap<>(); this.nodeList = nodeList; - for (int i = 0; i < nodeList.size(); i++) mainList.put(nodeList.get(i), new ArrayList<>()); + for (Integer value : nodeList) mainList.put(value, new ArrayList<>()); degreeList = new HashMap<>(); - for (int i = 0; i < nodeList.size(); i++) degreeList.put(nodeList.get(i), 0); + for (Integer integer : nodeList) degreeList.put(integer, 0); for (Node node : nodes) { mainList.get(node.source).add(node.dest);