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

Commit440e3b3

Browse files
committed
FX_NO_DELEGATE_CREATE_DELEGATE_FROM_STATIC_METHOD --- dead code
1 parent064bb67 commit440e3b3

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ namespace Microsoft.FSharp.Control
7373

7474
let mutablemulticast:'Delegate= Unchecked.defaultof<_>
7575

76-
#if!FX_NO_DELEGATE_CREATE_DELEGATE_FROM_STATIC_METHOD
7776
static letmi,argTypes=
7877
letinstanceBindingFlags= BindingFlags.Instance||| BindingFlags.Public||| BindingFlags.NonPublic||| BindingFlags.DeclaredOnly
7978
letmi= typeof<'Delegate>.GetMethod("Invoke",instanceBindingFlags)
@@ -87,41 +86,31 @@ namespace Microsoft.FSharp.Control
8786
(System.Delegate.CreateDelegate(typeof<EventWrapper<'Delegate,'Args>>, mi):?> EventWrapper<'Delegate,'Args>)
8887
else
8988
null
90-
#endif
9189

9290
// For the multi-arg case, use a slower DynamicInvoke.
9391
static letinvokeInfo=
9492
letinstanceBindingFlags= BindingFlags.Instance||| BindingFlags.Public||| BindingFlags.NonPublic||| BindingFlags.DeclaredOnly
95-
#if FX_NO_DELEGATE_CREATE_DELEGATE_FROM_STATIC_METHOD
96-
typeof<EventDelegee<'Args>>.GetMethod("Invoke",instanceBindingFlags)
97-
#else
9893
letmi=
9994
typeof<EventDelegee<'Args>>.GetMethods(instanceBindingFlags)
10095
|> Seq.filter(fun mi-> mi.Name="Invoke"&& mi.GetParameters().Length= argTypes.Length+1)
10196
|> Seq.exactlyOne
10297
if mi.IsGenericMethodDefinitionthen
10398
mi.MakeGenericMethod argTypes
10499
else
105-
mi
106-
#endif
107-
100+
mi
108101

109102
memberx.Trigger(sender:obj,args:'Args)=
110103
match box multicastwith
111104
|null->()
112105
|_->
113-
#if!FX_NO_DELEGATE_CREATE_DELEGATE_FROM_STATIC_METHOD
114106
match invokerwith
115107
|null->
116-
#endif
117108
letargs= Array.append[| sender|](Microsoft.FSharp.Reflection.FSharpValue.GetTupleFields(box args))
118109
multicast.DynamicInvoke(args)|> ignore
119-
#if!FX_NO_DELEGATE_CREATE_DELEGATE_FROM_STATIC_METHOD
120110
|_->
121111
// For the one-argument case, use an optimization that allows a fast call.
122112
// CreateDelegate creates a delegate that is fast to invoke.
123113
invoker.Invoke(multicast, sender, args)|> ignore
124-
#endif
125114

126115
memberx.Publish=
127116
// Note, we implement each interface explicitly: this works around a bug in the CLR

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp