Skip to content

Commit 93fcf10

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
mark methods as const in nodes
Summary: changelog: [internal] mark more methods as const and noexcept. Reviewed By: mdvacca Differential Revision: D75218535
1 parent c90e4ce commit 93fcf10

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/react-native/ReactCxxPlatform/react/renderer/animated/NativeAnimatedNodesManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ void NativeAnimatedNodesManager::updateNodes(
490490
nodesQueue.pop_front();
491491
// in Animated, value nodes like RGBA are parents and Color node is child
492492
// (the opposite of tree structure)
493-
for (const auto childTag : nextNode.node->children()) {
493+
for (const auto childTag : nextNode.node->getChildren()) {
494494
auto child = getAnimatedNode<AnimatedNode>(childTag);
495495
child->activeIncomingNodes++;
496496
if (child->bfsColor != animatedGraphBFSColor_) {
@@ -554,7 +554,7 @@ void NativeAnimatedNodesManager::updateNodes(
554554
nextNode.node->update();
555555
}
556556

557-
for (auto childTag : nextNode.node->children()) {
557+
for (auto childTag : nextNode.node->getChildren()) {
558558
auto child = getAnimatedNode<AnimatedNode>(childTag);
559559
child->activeIncomingNodes--;
560560
if (child->activeIncomingNodes == 0 && child->activeIncomingNodes == 0) {

packages/react-native/ReactCxxPlatform/react/renderer/animated/nodes/AnimatedNode.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,23 @@ class AnimatedNode {
5454
AnimatedNode(const AnimatedNode&) = default;
5555
AnimatedNode& operator=(const AnimatedNode&) = default;
5656

57-
Tag tag() const {
57+
Tag tag() const noexcept {
5858
return tag_;
5959
}
6060

6161
void addChild(Tag tag);
6262

6363
void removeChild(Tag tag);
6464

65-
const std::unordered_set<Tag>& children() const {
65+
const std::unordered_set<Tag>& getChildren() const noexcept {
6666
return children_;
6767
}
6868

69-
AnimatedNodeType type() const {
69+
AnimatedNodeType type() const noexcept {
7070
return type_;
7171
}
7272

73-
const folly::dynamic& getConfig() const {
73+
const folly::dynamic& getConfig() const noexcept {
7474
return config_;
7575
}
7676

packages/react-native/ReactCxxPlatform/react/renderer/animated/nodes/StyleAnimatedNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class StyleAnimatedNode final : public AnimatedNode {
2424
NativeAnimatedNodesManager& manager);
2525
void update() override;
2626

27-
const folly::dynamic& getProps() const {
27+
const folly::dynamic& getProps() const noexcept {
2828
return props_;
2929
}
3030

0 commit comments

Comments
 (0)