Skip to content

Commit

Permalink
undo change to package.json
Browse files Browse the repository at this point in the history
update type check to Sync and address feedback
  • Loading branch information
Yisrael Union committed Sep 17, 2024
1 parent fbbeec6 commit 438eabb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
36 changes: 35 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions std/shared/src/main/scala/cats/effect/std/MapRef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ object MapRef extends MapRefCompanionPlatform {
* the default Constructor for MapRef. If Async is available, it will use a ConcurrentHashMap,
* otherwise it will use a sharded immutable map.
*/
def apply[F[_]: Concurrent, K, V](): F[MapRef[F, K, Option[V]]] = {

def apply[F[_]: Concurrent, K, V]: F[MapRef[F, K, Option[V]]] = {
Concurrent[F] match {
case a: Async[_] =>
implicit val async: Async[F] = a
ofConcurrentHashMap()
case s: Sync[F] =>
ofConcurrentHashMap()(s)
case _ =>
ofShardedImmutableMap[F, K, V](Runtime.getRuntime.availableProcessors())
ofShardedImmutableMap[F, K, V](shardCount = Runtime.getRuntime.availableProcessors())
}

}
Expand Down

0 comments on commit 438eabb

Please sign in to comment.