Skip to content

Commit a0ec41f

Browse files
committed
Fix unnecessary allocation for HighResTimer
There's a minor optimization in HighResTimer where we can avoid allocating a new EventArgs object every time the timer elapses. Instead, we can use EventArgs.Empty to reduce memory usage and improve performance which is especially important in resource-constrained environments. Signed-off-by: Anton Kulikov <[email protected]>
1 parent 4a3d148 commit a0ec41f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nanoFramework.Hardware.Esp32/HighResTimer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ internal void OnHighResTimerExpiredInternal(object e)
5050
}
5151
}
5252

53-
callbacks?.Invoke(this, new EventArgs());
53+
callbacks?.Invoke(this, EventArgs.Empty);
5454
}
5555

5656
/// <summary>

0 commit comments

Comments
 (0)