Skip to content

Commit

Permalink
remove unused arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Feb 6, 2025
1 parent 1130307 commit 2ba6a09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lila/src/main/scala/ConcurrentMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class ConcurrentMap[K, V](initialCapacity: Int):
/* Runs f exactly once and returns the new value */
def compute(key: K)(f: Option[V] => Option[V]): Option[V] =
Option:
underlying.compute(key, (k, v) => f(Option(v)).getOrElse(null.asInstanceOf[V]))
underlying.compute(key, (_, v) => f(Option(v)).getOrElse(null.asInstanceOf[V]))

/* Runs f at most once and returns the new value */
def computeIfPresent(key: K)(f: V => Option[V]): Option[V] =
Option:
underlying.computeIfPresent(key, (k, v) => f(v).getOrElse(null.asInstanceOf[V]))
underlying.computeIfPresent(key, (_, v) => f(v).getOrElse(null.asInstanceOf[V]))

/* Runs f at most once and returns the new value */
def computeIfAbsent(key: K)(f: => Option[V]): Option[V] =
Expand Down

0 comments on commit 2ba6a09

Please sign in to comment.