perf: avoid unnecessary shared_ptr copies in Fabric components (#2164)

Ports the upstream best-practice around props handling of shared_ptr in a855013fc6
This commit is contained in:
Pieter De Baets
2023-10-25 11:23:14 +01:00
committed by GitHub
parent a5dae2f54d
commit 5208a2f6a7
21 changed files with 22 additions and 23 deletions

View File

@@ -29,12 +29,11 @@ class RNSVGImageComponentDescriptor final
void adopt(ShadowNode::Unshared const &shadowNode) const override {
ConcreteComponentDescriptor::adopt(shadowNode);
auto imageShadowNode =
std::static_pointer_cast<RNSVGImageShadowNode>(shadowNode);
auto &imageShadowNode = static_cast<RNSVGImageShadowNode &>(*shadowNode);
// `RNSVGImageShadowNode` uses `ImageManager` to initiate image loading and
// communicate the loading state and results to mounting layer.
imageShadowNode->setImageManager(imageManager_);
imageShadowNode.setImageManager(imageManager_);
}
private: