Use LinkedHashMap for mapOf

This commit is contained in:
yushijinhun
2018-07-20 16:26:15 +08:00
parent 088af981df
commit f9e9c9d38b

View File

@@ -41,7 +41,7 @@ public final class Lang {
*/
@SafeVarargs
public static <K, V> Map<K, V> mapOf(Pair<K, V>... pairs) {
HashMap<K, V> map = new HashMap<>();
Map<K, V> map = new LinkedHashMap<>();
for (Pair<K, V> pair : pairs)
map.put(pair.getKey(), pair.getValue());
return map;