mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 15:14:18 +00:00
perf: avoid unnecessary shared_ptr copies in Fabric components (#2164)
Ports the upstream best-practice around props handling of shared_ptr in https://github.com/facebook/react-native/commit/a855013fc6c963aca2282b6b43aeeb621eeb88d7
This commit is contained in:
@@ -41,7 +41,7 @@ using namespace facebook::react;
|
||||
|
||||
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
||||
{
|
||||
const auto &newProps = *std::static_pointer_cast<const RNSVGForeignObjectProps>(props);
|
||||
const auto &newProps = static_cast<const RNSVGForeignObjectProps &>(*props);
|
||||
|
||||
self.x = RCTNSStringFromStringNilIfEmpty(newProps.x)
|
||||
? [RNSVGLength lengthWithString:RCTNSStringFromString(newProps.x)]
|
||||
|
||||
Reference in New Issue
Block a user