mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Using non-mutating at instead of [] for -[RCTSurfaceTouchHandler _activeTouches]
Summary: Every C++ engineer (except me several months ago) knows that `operator []` can mutate the collection (Yeah! Don't ask), so this is especially dangerous if your hash function is broken (see the previous diff). Reviewed By: mdvacca Differential Revision: D13072805 fbshipit-source-id: 4436a8ff12fb27a57bfb6ee0ff986d7a9a825549
This commit is contained in:
committed by
Facebook Github Bot
parent
1de79e12e1
commit
868406dbec
@@ -196,14 +196,14 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithTarget:(id)target action:(SEL)action
|
||||
- (void)_updateTouches:(NSSet<UITouch *> *)touches
|
||||
{
|
||||
for (UITouch *touch in touches) {
|
||||
UpdateActiveTouchWithUITouch(_activeTouches[touch], touch, _rootComponentView);
|
||||
UpdateActiveTouchWithUITouch(_activeTouches.at(touch), touch, _rootComponentView);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_unregisterTouches:(NSSet<UITouch *> *)touches
|
||||
{
|
||||
for (UITouch *touch in touches) {
|
||||
const auto &activeTouch = _activeTouches[touch];
|
||||
const auto &activeTouch = _activeTouches.at(touch);
|
||||
_identifierPool.enqueue(activeTouch.touch.identifier);
|
||||
_activeTouches.erase(touch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user