cache: script: use linkedhashmap for switch map

The switch maps are iterated in the assembler and disassembler and the generated code depends on the iteration order
This commit is contained in:
Tony Wang
2022-02-26 03:12:21 +08:00
committed by GitHub
parent d8c67fa9b8
commit 15a393fe86

View File

@@ -26,6 +26,7 @@ package net.runelite.cache.script.assembler;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -267,7 +268,7 @@ public class ScriptWriter extends rs2asmBaseListener
continue;
}
Map<Integer, Integer> map = maps[index++] = new HashMap<>();
Map<Integer, Integer> map = maps[index++] = new LinkedHashMap<>();
for (LookupCase scase : lswitch.getCases())
{