Implements some micro-optimizations
All checks were successful
Build / Build (push) Successful in 51s
All checks were successful
Build / Build (push) Successful in 51s
This commit is contained in:
@@ -173,7 +173,7 @@ public static class MoveTurnExecutor
|
||||
|
||||
hitData.Type = hitType;
|
||||
|
||||
var types = target.Types.ToList();
|
||||
var types = new List<TypeIdentifier>(target.Types);
|
||||
executingMove.RunScriptHook(x => x.ChangeTypesForMove(executingMove, target, hitIndex, types));
|
||||
target.RunScriptHook(x => x.ChangeTypesForIncomingMove(executingMove, target, hitIndex, types));
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Dynamic.Events;
|
||||
|
||||
/// <summary>
|
||||
@@ -10,8 +12,18 @@ namespace PkmnLib.Dynamic.Events;
|
||||
/// </remarks>
|
||||
public readonly record struct EventBatchId()
|
||||
{
|
||||
private static readonly RandomImpl RootRandom = new();
|
||||
|
||||
private static readonly ThreadLocal<RandomImpl> Random = new(() =>
|
||||
{
|
||||
lock (RootRandom)
|
||||
{
|
||||
return new RandomImpl(RootRandom.GetInt());
|
||||
}
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier for this batch of events.
|
||||
/// </summary>
|
||||
public Guid Id { get; init; } = Guid.NewGuid();
|
||||
public Guid Id { get; init; } = Random.Value.NewGuid();
|
||||
}
|
||||
Reference in New Issue
Block a user