From 4da9e954df3846d01aa0536f4e8143466a1d62f3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 11 Feb 2022 00:49:49 -0500 Subject: use Array.Empty to avoid unneeded array allocations --- src/SMAPI/Events/ButtonsChangedEventArgs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SMAPI/Events/ButtonsChangedEventArgs.cs') diff --git a/src/SMAPI/Events/ButtonsChangedEventArgs.cs b/src/SMAPI/Events/ButtonsChangedEventArgs.cs index dda41692..a5e87735 100644 --- a/src/SMAPI/Events/ButtonsChangedEventArgs.cs +++ b/src/SMAPI/Events/ButtonsChangedEventArgs.cs @@ -58,7 +58,7 @@ namespace StardewModdingAPI.Events foreach (var state in new[] { SButtonState.Pressed, SButtonState.Held, SButtonState.Released }) { if (!lookup.ContainsKey(state)) - lookup[state] = new SButton[0]; + lookup[state] = Array.Empty(); } return lookup; -- cgit