Use LinkedHashMap for mapOf

This commit is contained in:
yushijinhun 2018-07-20 16:26:15 +08:00
parent 088af981df
commit f9e9c9d38b
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4

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;