Closed Lasering closed 1 year ago
def updateOrDelete[V1 >: V](key: K)(updateOrDelete: Option[V1]): Map[K, V1] = updateOrDelete match { case None => this.removed(key) case Some(value) => this.updated(key, value) }
You can already do this using updatedWith like:
updatedWith
map.updatedWith(key)(_ => updateOrDelete)