From e6d566fcb98ca76a9f79d790fe37e1695ff898cd Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 18 Nov 2019 18:22:35 -0800 Subject: [PATCH] Fabric: More asserts in RCTMountingTransactionObserverCoordinator Summary: Just asserts to be sure that we don't over-insert or over-erase to/from the collection. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D18567732 fbshipit-source-id: 569dbce6e62380ae3a0716448ad10bf418aa4f9c --- .../Mounting/RCTMountingTransactionObserverCoordinator.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm b/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm index 405818ce92b..39d56121b2f 100644 --- a/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +++ b/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm @@ -21,6 +21,7 @@ void RCTMountingTransactionObserverCoordinator::registerViewComponentDescriptor( } auto &surfaceRegistry = registry_[surfaceId]; + assert(surfaceRegistry.count(componentViewDescriptor) == 0); surfaceRegistry.insert(componentViewDescriptor); } @@ -34,6 +35,7 @@ void RCTMountingTransactionObserverCoordinator::unregisterViewComponentDescripto } auto &surfaceRegistry = registry_[surfaceId]; + assert(surfaceRegistry.count(componentViewDescriptor) == 1); surfaceRegistry.erase(componentViewDescriptor); }