override def ++()

in algebird-core/src/main/scala/com/twitter/algebird/CountMinSketch.scala [700:712]


  override def ++(other: CMS[K]): CMS[K] =
    other match {
      case _: CMSZero[_]     => this
      case other: CMSItem[K] => this + other.item
      case other: SparseCMS[K] =>
        other.exactCountTable.foldLeft(this) { case (cms, (x, count)) =>
          cms + (x, count)
        }
      case other: CMSInstance[K] =>
        val newTable = countsTable ++ other.countsTable
        val newTotalCount = totalCount + other.totalCount
        CMSInstance[K](newTable, newTotalCount, params)
    }