Skip to content

Commit 6af38e6

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
remove superclass enable_shared_from_this from AnimationDriver
Summary: 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
1 parent d65a9d8 commit 6af38e6

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

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)