mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Small optimization in RCTMountingManager
Summary: `pullTransaction` can return an empty transaction. That's fine to interate over the empty collection and do nothing, but it's inneficient because we also call delegate methods around the loop (that can be expensive). Reviewed By: sammy-SC Differential Revision: D17053430 fbshipit-source-id: c78959d47ea22cd9bb99419f6a80de3ac8e89fd3
This commit is contained in:
committed by
Facebook Github Bot
parent
33112a1c20
commit
28d26c2e56
@@ -251,10 +251,15 @@ static void RNPerformMountInstructions(ShadowViewMutationList const &mutations,
|
||||
}
|
||||
|
||||
auto surfaceId = transaction->getSurfaceId();
|
||||
auto &mutations = transaction->getMutations();
|
||||
|
||||
if (mutations.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
RCTAssertMainQueue();
|
||||
[self.delegate mountingManager:self willMountComponentsWithRootTag:surfaceId];
|
||||
RNPerformMountInstructions(transaction->getMutations(), self.componentViewRegistry);
|
||||
RNPerformMountInstructions(mutations, self.componentViewRegistry);
|
||||
[self.delegate mountingManager:self didMountComponentsWithRootTag:surfaceId];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user