From 2afcea2b91c21b4c5c43fdb58443c5efbbe52f19 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 7 Oct 2022 04:44:48 -0700 Subject: [PATCH] Track observed pointer-events using a single bitset Summary: Noticed that we were using a different tag for each pointer event observed (and that weren't clearing these properly when recyling views). Each of these tags is a hashmap entry and a boxed boolean, so we can do much better by just using a single (boxed) integer. Changelog: [Internal] Reviewed By: rshest Differential Revision: D40077519 fbshipit-source-id: 130e78c3641eaedfa8787644b98763fd4367bc27 --- .../react/uimanager/BaseViewManager.java | 33 ++++++++------ .../uimanager/events/PointerEventHelper.java | 40 ++--------------- .../main/res/views/uimanager/values/ids.xml | 43 ++++++------------- 3 files changed, 36 insertions(+), 80 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java index ea0e3e4f33c..f32bc44be2d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java @@ -27,6 +27,7 @@ import com.facebook.react.common.MapBuilder; import com.facebook.react.common.ReactConstants; import com.facebook.react.uimanager.ReactAccessibilityDelegate.AccessibilityRole; import com.facebook.react.uimanager.annotations.ReactProp; +import com.facebook.react.uimanager.events.PointerEventHelper; import com.facebook.react.uimanager.util.ReactFindViewUtil; import java.util.ArrayList; import java.util.HashMap; @@ -68,9 +69,7 @@ public abstract class BaseViewManager - + - + - + - + - + - + - + - + - + - + + - - - - - - - - - - - - - - - - - - - - + +