Skip to content

Commit 6c05300

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
remove superclass enable_shared_from_this from AnimationDriver (#51611)
Summary: Pull Request resolved: #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
1 parent 5bbf7e6 commit 6c05300

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/react-native/ReactCxxPlatform/react/renderer/animated/drivers/AnimationDriver.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ enum class AnimationDriverType {
2222
Decay,
2323
};
2424

25-
class ValueAnimatedNode;
26-
class AnimationDriver : public std::enable_shared_from_this<AnimationDriver> {
25+
class AnimationDriver {
2726
public:
2827
AnimationDriver(
2928
int id,
@@ -47,11 +46,11 @@ class AnimationDriver : public std::enable_shared_from_this<AnimationDriver> {
4746
return endCallback_;
4847
}
4948

50-
virtual double toValue() {
49+
virtual double toValue() const noexcept {
5150
return 0;
5251
}
5352

54-
bool isComplete() {
53+
bool isComplete() const noexcept {
5554
return isComplete_;
5655
}
5756

packages/react-native/ReactCxxPlatform/react/renderer/animated/drivers/FrameAnimationDriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ FrameAnimationDriver::FrameAnimationDriver(
3535
onConfigChanged();
3636
}
3737

38-
double FrameAnimationDriver::toValue() {
38+
double FrameAnimationDriver::toValue() const noexcept {
3939
return toValue_;
4040
}
4141

packages/react-native/ReactCxxPlatform/react/renderer/animated/drivers/FrameAnimationDriver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FrameAnimationDriver : public AnimationDriver {
2424
const folly::dynamic& config,
2525
NativeAnimatedNodesManager* manager);
2626

27-
double toValue() override;
27+
double toValue() const noexcept override;
2828

2929
protected:
3030
bool update(double timeDeltaMs, bool restarting) override;

0 commit comments

Comments
 (0)