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
This commit is contained in:
Valentin Shergin
2019-11-18 18:22:35 -08:00
committed by Facebook Github Bot
parent e4a23f72d5
commit e6d566fcb9
@@ -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);
}