mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
remove superclass enable_shared_from_this from AnimationDriver (#51611)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51611 changelog: [internal] AnimationDriver does not use enable_shared_from_this, let's remove it. Also mark a few methods as noexcept and const. This helps with C++ binary size. Reviewed By: rshest Differential Revision: D75172851 fbshipit-source-id: d6552cd577371a51c3fa3b394b451d7ed2b61e44
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5bbf7e60a9
commit
6c053006b8
+3
-4
@@ -22,8 +22,7 @@ enum class AnimationDriverType {
|
||||
Decay,
|
||||
};
|
||||
|
||||
class ValueAnimatedNode;
|
||||
class AnimationDriver : public std::enable_shared_from_this<AnimationDriver> {
|
||||
class AnimationDriver {
|
||||
public:
|
||||
AnimationDriver(
|
||||
int id,
|
||||
@@ -47,11 +46,11 @@ class AnimationDriver : public std::enable_shared_from_this<AnimationDriver> {
|
||||
return endCallback_;
|
||||
}
|
||||
|
||||
virtual double toValue() {
|
||||
virtual double toValue() const noexcept {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool isComplete() {
|
||||
bool isComplete() const noexcept {
|
||||
return isComplete_;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ FrameAnimationDriver::FrameAnimationDriver(
|
||||
onConfigChanged();
|
||||
}
|
||||
|
||||
double FrameAnimationDriver::toValue() {
|
||||
double FrameAnimationDriver::toValue() const noexcept {
|
||||
return toValue_;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ class FrameAnimationDriver : public AnimationDriver {
|
||||
const folly::dynamic& config,
|
||||
NativeAnimatedNodesManager* manager);
|
||||
|
||||
double toValue() override;
|
||||
double toValue() const noexcept override;
|
||||
|
||||
protected:
|
||||
bool update(double timeDeltaMs, bool restarting) override;
|
||||
|
||||
Reference in New Issue
Block a user