You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/SMAPI/Framework/Events/ManagedEvent.cs
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -97,8 +97,7 @@ public void Remove(EventHandler<TEventArgs> handler)
97
97
/// <param name="args">The event arguments to pass.</param>
98
98
publicvoidRaise(TEventArgsargs)
99
99
{
100
-
// skip if no handlers
101
-
if(this.Handlers.Count==0)
100
+
if(!this.HasListeners)
102
101
return;
103
102
104
103
// raise event
@@ -125,8 +124,7 @@ public void Raise(TEventArgs args)
125
124
/// <param name="invoke">Invoke an event handler. This receives the mod which registered the handler, and should invoke the callback with the event arguments to pass it.</param>
0 commit comments