From 75b9f9d5ddc7927a9c6d0f2c5f6c2153293873f5 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 21 Oct 2019 06:25:41 -0700 Subject: [PATCH] Fabric: Add proper type to TargetState Summary: There isn't a need for using `std::shared_ptr` as the type is known. changelog: [internal] Reviewed By: shergin Differential Revision: D18032518 fbshipit-source-id: 7860f9be8ba1a05a725e8bf7260a496d51194f2f --- ReactCommon/fabric/core/state/StateTarget.cpp | 2 +- ReactCommon/fabric/core/state/StateTarget.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/core/state/StateTarget.cpp b/ReactCommon/fabric/core/state/StateTarget.cpp index ad58e71773a2f8..1e132d6e5cd0ea 100644 --- a/ReactCommon/fabric/core/state/StateTarget.cpp +++ b/ReactCommon/fabric/core/state/StateTarget.cpp @@ -22,7 +22,7 @@ StateTarget::operator bool() const { const ShadowNode &StateTarget::getShadowNode() const { assert(shadowNode_ && "Stored pointer to a ShadowNode must not be null."); - return *std::static_pointer_cast(shadowNode_); + return *shadowNode_; } } // namespace react diff --git a/ReactCommon/fabric/core/state/StateTarget.h b/ReactCommon/fabric/core/state/StateTarget.h index de847e8ae64de5..31a0f53eb15b45 100644 --- a/ReactCommon/fabric/core/state/StateTarget.h +++ b/ReactCommon/fabric/core/state/StateTarget.h @@ -50,7 +50,7 @@ class StateTarget { const ShadowNode &getShadowNode() const; private: - std::shared_ptr shadowNode_; + std::shared_ptr shadowNode_; }; } // namespace react