Fix SupplierMap not preserving order of keys
This commit is contained in:
parent
158f68e068
commit
940801d247
@ -1,14 +1,13 @@
|
|||||||
package ru.dbotthepony.mc.otm.core.collect
|
package ru.dbotthepony.mc.otm.core.collect
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap
|
|
||||||
import com.google.common.collect.ImmutableSet
|
import com.google.common.collect.ImmutableSet
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap
|
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap
|
||||||
import ru.dbotthepony.mc.otm.core.stream
|
import ru.dbotthepony.mc.otm.core.stream
|
||||||
import java.util.function.Supplier
|
import java.util.function.Supplier
|
||||||
import java.util.stream.Stream
|
import java.util.stream.Stream
|
||||||
|
|
||||||
class SupplierMap<K, T>(values: Stream<Pair<K, Supplier<T>>>) : Map<K, T> {
|
class SupplierMap<K, T>(values: Stream<Pair<K, Supplier<T>>>) : Map<K, T> {
|
||||||
private val backing = Object2ObjectOpenHashMap<K, Supplier<T>>()
|
private val backing = Object2ObjectLinkedOpenHashMap<K, Supplier<T>>()
|
||||||
override val entries: Set<Map.Entry<K, T>>
|
override val entries: Set<Map.Entry<K, T>>
|
||||||
override val keys: Set<K>
|
override val keys: Set<K>
|
||||||
get() = backing.keys
|
get() = backing.keys
|
||||||
|
Loading…
Reference in New Issue
Block a user