perf: DelegateExtensions.InvokeSafe marked obsolete for memory allocation reasons, soon to be removed
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Syntriax.Engine.Core;
|
||||
|
||||
public static class DelegateExtensions
|
||||
{
|
||||
[Obsolete($"{nameof(InvokeSafe)} causes memory allocation, please use Invoke() instead.")]
|
||||
public static void InvokeSafe(this Delegate @delegate, params object?[] args)
|
||||
{
|
||||
foreach (Delegate invocation in Delegate.EnumerateInvocationList(@delegate))
|
||||
|
@@ -19,10 +19,10 @@ public class ProgressionTracker : IProgressionTracker
|
||||
Progression = progression.Clamp(Progression, 1f);
|
||||
Status = status;
|
||||
|
||||
OnUpdated?.InvokeSafe(this, previousProgression, previousStatus);
|
||||
OnUpdated?.Invoke(this, previousProgression, previousStatus);
|
||||
|
||||
if (progression >= 1f)
|
||||
OnEnded?.InvokeSafe(this);
|
||||
OnEnded?.Invoke(this);
|
||||
}
|
||||
|
||||
void IProgressionTracker.Reset()
|
||||
|
Reference in New Issue
Block a user