Skip to content

Commit

Permalink
remove asInstanceOf in ConcurrentWeakIdentityHashMapCache
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Jul 26, 2021
1 parent 6998410 commit 594c617
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ case class ConcurrentWeakIdentityHashMapCache(

def memo[V](key: AnyRef, value: =>V): V = {
lazy val v = value
if (map.putIfAbsent(key.asInstanceOf[AnyRef], Eval.later(v).memoize) == null) v
else map.get(key.asInstanceOf[AnyRef]).value.asInstanceOf[V]
if (map.putIfAbsent(key, Eval.later(v).memoize) == null) v
else map.get(key).value.asInstanceOf[V]
}

def put[V](key: AnyRef, value: V): V =
Expand Down

0 comments on commit 594c617

Please sign in to comment.