Skip to content

Commit

Permalink
Remove unused methods from ArrayMap.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Feb 20, 2024
1 parent c85e0e9 commit 0fca8b9
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,6 @@ class ArrayMap<K : Comparable<K>, V : Any>(private val data: Array<Any>) : Map<K
}
override fun hashCode(): Int = entries.hashCode()
override fun toString() = this.toMutableMap().toString()
fun minusOrNoOp(key: K, value: V): ArrayMap<K, V> {
val idxExisting = dataAsKeys.binarySearch(key)
if (idxExisting >= 0) {
val existingValue = data[idxExisting * 2 + 1] as V
if (value == existingValue) {
return minusSortedIndices(listOf(idxExisting))
}
}
return this
}
fun minusOrNoOp(key: K): ArrayMap<K, V> {
val idxExisting = dataAsKeys.binarySearch(key)
return if (idxExisting >= 0) {
minusSortedIndices(listOf(idxExisting))
} else this
}

companion object {
private val EMPTY = ArrayMap<String, Any>(arrayOf())
Expand Down

0 comments on commit 0fca8b9

Please sign in to comment.