perf: no wrapper

This commit is contained in:
cneicy committed 2026-03-09 17:42:06 +08:00
1 parent 67a8216c64
commit c15c14e394
4 files changed
+33 -113

No files matched your search

+2 -1
View File
@@ -7,6 +7,7 @@ namespace ShrinkEventBus
{
private static readonly Stack<T> Pool = new(32);
private static readonly object Lock = new();
private static readonly Action<EventBase> CachedReleaseAction = e => Release((T)e);
public static T Get()
{
@@ -21,7 +22,7 @@ namespace ShrinkEventBus
}
var newEvt = new T();
newEvt.ReleaseAction = e => Release((T)e);
newEvt.ReleaseAction = CachedReleaseAction;
return newEvt;
}