Skip to content

Commit

Permalink
Usee concurrent dictionary without option type - references #1101
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Oct 1, 2015
1 parent bfca98f commit 5080db2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Paket.Core/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ let inline createWebClient(url,auth:Auth option) =
//More generic variant of http://www.fssnip.net/c4
open System.Collections.Concurrent

let cache = ConcurrentDictionary<(string * obj) option, Lazy<obj>>()
let cache = ConcurrentDictionary<(string * obj), Lazy<obj>>()
let memoizeConcurrent (caller : string) (f : 'a -> 'b) =
fun (x : 'a) -> (cache.GetOrAdd(Some(caller, x |> box), lazy ((f x) |> box)).Force() |> unbox) : 'b
fun (x : 'a) -> (cache.GetOrAdd((caller, x |> box), lazy ((f x) |> box)).Force() |> unbox) : 'b

#nowarn "40"

Expand Down

0 comments on commit 5080db2

Please sign in to comment.