diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-02-11 00:49:49 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-02-11 00:49:49 -0500 |
commit | 4da9e954df3846d01aa0536f4e8143466a1d62f3 (patch) | |
tree | ac4f969399b844f2c0bee0204b0b3a3c4d83e91d /src/SMAPI/Framework/Events/ManagedEvent.cs | |
parent | 233a7d57e6b138dcbd651bb9bc5d0a0c66b207bb (diff) | |
download | SMAPI-4da9e954df3846d01aa0536f4e8143466a1d62f3.tar.gz SMAPI-4da9e954df3846d01aa0536f4e8143466a1d62f3.tar.bz2 SMAPI-4da9e954df3846d01aa0536f4e8143466a1d62f3.zip |
use Array.Empty to avoid unneeded array allocations
Diffstat (limited to 'src/SMAPI/Framework/Events/ManagedEvent.cs')
-rw-r--r-- | src/SMAPI/Framework/Events/ManagedEvent.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/Events/ManagedEvent.cs b/src/SMAPI/Framework/Events/ManagedEvent.cs index fa20a079..f48c3aeb 100644 --- a/src/SMAPI/Framework/Events/ManagedEvent.cs +++ b/src/SMAPI/Framework/Events/ManagedEvent.cs @@ -21,7 +21,7 @@ namespace StardewModdingAPI.Framework.Events private readonly List<ManagedEventHandler<TEventArgs>> Handlers = new List<ManagedEventHandler<TEventArgs>>(); /// <summary>A cached snapshot of <see cref="Handlers"/>, or <c>null</c> to rebuild it next raise.</summary> - private ManagedEventHandler<TEventArgs>[] CachedHandlers = new ManagedEventHandler<TEventArgs>[0]; + private ManagedEventHandler<TEventArgs>[] CachedHandlers = Array.Empty<ManagedEventHandler<TEventArgs>>(); /// <summary>The total number of event handlers registered for this events, regardless of whether they're still registered.</summary> private int RegistrationIndex; |