From b2d67e9d4b9707177192d46d7c824e8ac99f8f9d Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 25 Jun 2021 16:26:50 -0400 Subject: [PATCH] Stop allocating two RawMouseActions[] arrays in PreNotifyInput --- .../src/PresentationCore/System/Windows/Input/MouseDevice.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/MouseDevice.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/MouseDevice.cs index f2c33ba1816..41a0b72fcea 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/MouseDevice.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/MouseDevice.cs @@ -1736,7 +1736,7 @@ private void PreNotifyInput(object sender, NotifyInputEventArgs e) actions |= RawMouseActions.QueryCursor; } - RawMouseActions[] ButtonPressActions = + ReadOnlySpan ButtonPressActions = stackalloc RawMouseActions[5] { RawMouseActions.Button1Press, RawMouseActions.Button2Press, @@ -1745,7 +1745,7 @@ private void PreNotifyInput(object sender, NotifyInputEventArgs e) RawMouseActions.Button5Press }; - RawMouseActions[] ButtonReleaseActions = + ReadOnlySpan ButtonReleaseActions = stackalloc RawMouseActions[5] { RawMouseActions.Button1Release, RawMouseActions.Button2Release,