λ
it match {
case it: Iterable[_] if it.isEmpty => empty[K, V]
case m: Map[K, V] => m
case _ => (newBuilder[K, V] ++= it).result()
}
Size: a a a
λ
AM
λ
λ
λ
λ
AM
addOne(key: K, value: V): this.type = {
if (switchedToHashMapBuilder) {
hashMapBuilder.addOne(key, value)
} else if (elems.size < 4) {
elems = elems.updated(key, value)
} else {
// assert(elems.size == 4)
if (elems.contains(key)) {
elems = elems.updated(key, value)
} else {
switchedToHashMapBuilder = true(hashMapBuilder == null) {
hashMapBuilder = new HashMapBuilder
}
elems.asInstanceOf[Map4[K, V]].buildTo(hashMapBuilder)
hashMapBuilder.addOne(key, value)
}
}
this}λ
AM
addOne(elem: (K, V)): this.type = {
ensureUnaliased()
val h = elem._1.##
val im = improve(h)
update(rootNode, elem._1, elem._2, h, im, 0)
this}AM
AM
GP
λ
λ
AM
AM
.to(mutable.Map)AM
AM
λ
λ