8000 fix up some logic ive broken previously · dotnet/wpf@f684b2b · GitHub
[go: up one dir, main page]

Skip to content

Commit f684b2b

Browse files
committed
fix up some logic ive broken previously
1 parent e3f6978 commit f684b2b

File tree

1 file changed

+2
-2
lines changed
  • src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies

1 file changed

+2
-2
lines changed

src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WinEventTracker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ private static void WinEventProc(int winEventHook, int eventId, IntPtr hwnd, int
210210

211211
try
212212
{
213-
int evt = EventIdToIndex.Length > eventId ? EventIdToIndex[eventId] : -1;
213+
int evt = EventIdToIndex.BinarySearch(eventId);
214214
if (evt < 0)
215215
return; // negative means this event is unknown so ignore it
216216

@@ -353,7 +353,7 @@ private static void BuildEventsList (EventFlag eFlag, IntPtr hwnd, ProxyRaiseEve
353353
EvtIdProperty evtIdProp = aEvtIdProp[i];
354354

355355
// Map a property into a WinEventHookProperty
356-
int evt = EventIdToIndex.Length > evtIdProp._evtId ? EventIdToIndex[evtIdProp._evtId] : -1;
356+
int evt = EventIdToIndex.BinarySearch(evtIdProp._evtId);
357357

358358
// add the window to the list
359359
if (evt >= 0)

0 commit comments

Comments
 (0)
0