Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit81612fb

Browse files
committed
FX_NO_CONCURRENT_DICTIONARY --- dead code removeall
1 parent609aa56 commit81612fb

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

‎src/fsharp/FSharp.Core/QueryExtensions.fs‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,8 @@ type Grouping<'K, 'T>(key:'K, values:seq<'T>) =
3838
moduleinternalAdapters=
3939

4040
letmemoize f=
41-
#if FX_NO_CONCURRENT_DICTIONARY
42-
// No concurrent dictionary or TPL on "old-style" portable
43-
letd=new System.Collections.Generic.Dictionary<Type,_>(HashIdentity.Structural)
44-
fun x->
45-
let mutableres= Unchecked.defaultof<_>
46-
System.Threading.Monitor.Enter(d)
47-
try
48-
if d.TryGetValue(x,&res)then
49-
res
50-
else
51-
letres= f x
52-
d.[x]<- res
53-
res
54-
finally
55-
System.Threading.Monitor.Exit(d)
56-
57-
#else
5841
letd=new System.Collections.Concurrent.ConcurrentDictionary<Type,'b>(HashIdentity.Structural)
5942
fun x-> d.GetOrAdd(x,fun r-> f r)
60-
#endif
6143

6244
letisPartiallyImmutableRecord:Type->bool=
6345
memoize(fun t->

‎src/fsharp/FSharp.Core/printf.fs‎

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,34 +1257,9 @@ module internal PrintfImpl =
12571257
/// 2nd level is global dictionary that maps format string to the corresponding PrintfFactory
12581258
typeCache<'T,'State,'Residue,'Result>()=
12591259
static letgenerate(fmt)= PrintfBuilder<'State, 'Residue, 'Result>().Build<'T>(fmt)
1260-
#if FX_NO_CONCURRENT_DICTIONARY
1261-
static let mutablemap= Dictionary<string, CachedItem<'T, 'State, 'Residue, 'Result>>()
1262-
#else
12631260
static let mutablemap= System.Collections.Concurrent.ConcurrentDictionary<string, CachedItem<'T, 'State, 'Residue, 'Result>>()
12641261
static letgetOrAddFunc= Func<_,_>(generate)
1265-
#endif
1266-
1267-
static letget(key:string)=
1268-
#if FX_NO_CONCURRENT_DICTIONARY
1269-
lock map(fun()->
1270-
let mutableres= Unchecked.defaultof<_>
1271-
if map.TryGetValue(key,&res)then res
1272-
else
1273-
letv=
1274-
#if DEBUG
1275-
try
1276-
generate(key)
1277-
with
1278-
e-> raise(ArgumentException("PRINTF::"+ key, e))
1279-
#else
1280-
generate(key)
1281-
#endif
1282-
map.Add(key, v)
1283-
v
1284-
)
1285-
#else
1286-
map.GetOrAdd(key, getOrAddFunc)
1287-
#endif
1262+
static letget(key:string)= map.GetOrAdd(key, getOrAddFunc)
12881263

12891264
[<DefaultValue>]
12901265
#if!FX_NO_THREAD_STATIC

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp