[K/N] Remove redundant AbstractMutableMap.SimpleEntry
This commit is contained in:
committed by
Space Team
parent
3be613ced8
commit
6015e12db8
@@ -18,28 +18,6 @@ public actual abstract class AbstractMutableMap<K, V> protected actual construct
|
||||
actual abstract override fun put(key: K, value: V): V?
|
||||
|
||||
|
||||
/**
|
||||
* A mutable [Map.Entry] shared by several [Map] implementations.
|
||||
*/
|
||||
internal open class SimpleEntry<K, V>(override val key: K, value: V) : MutableMap.MutableEntry<K, V> {
|
||||
constructor(entry: Map.Entry<K, V>) : this(entry.key, entry.value)
|
||||
|
||||
private var _value = value
|
||||
|
||||
override val value: V get() = _value
|
||||
|
||||
override fun setValue(newValue: V): V {
|
||||
val oldValue = this._value
|
||||
this._value = newValue
|
||||
return oldValue
|
||||
}
|
||||
|
||||
override fun hashCode(): Int = entryHashCode(this)
|
||||
override fun toString(): String = entryToString(this)
|
||||
override fun equals(other: Any?): Boolean = entryEquals(this, other)
|
||||
}
|
||||
|
||||
|
||||
actual override fun putAll(from: Map<out K, V>) {
|
||||
for ((key, value) in from) {
|
||||
put(key, value)
|
||||
|
||||
Reference in New Issue
Block a user