perf: DelegateExtensions.InvokeSafe marked obsolete for memory allocation reasons, soon to be removed

This commit is contained in:
2025-05-29 21:48:08 +03:00
parent 1b0f25e854
commit bf8fbebae3
35 changed files with 116 additions and 115 deletions

View File

@@ -14,7 +14,7 @@ public class EntityRegistry
public void Add(IEntity entity)
{
if (registeredEntities.TryAdd(entity.Id, entity))
OnEntityRegistered?.InvokeSafe(this, entity);
OnEntityRegistered?.Invoke(this, entity);
}
public void QueueAssign(string id, Action<IEntity> setMethod)
@@ -26,7 +26,7 @@ public class EntityRegistry
public void AssignAll()
{
foreach ((string id, Action<IEntity>? action) in assignCallbacks)
action?.InvokeSafe(registeredEntities[id]);
action?.Invoke(registeredEntities[id]);
}
public void Reset()