mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-05 22:56:11 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user