@@ -78,7 +78,7 @@ NativeAnimatedNodesManager::~NativeAnimatedNodesManager() noexcept {
7878
7979std::optional<double > NativeAnimatedNodesManager::getValue (Tag tag) noexcept {
8080 auto node = getAnimatedNode<ValueAnimatedNode>(tag);
81- if (node) {
81+ if (node != nullptr ) {
8282 return node->getValue ();
8383 } else {
8484 LOG (WARNING )
@@ -156,7 +156,7 @@ void NativeAnimatedNodesManager::connectAnimatedNodes(
156156 auto parentNode = getAnimatedNode<AnimatedNode>(parentTag);
157157 auto childNode = getAnimatedNode<AnimatedNode>(childTag);
158158
159- if (parentNode && childNode) {
159+ if (( parentNode != nullptr ) && ( childNode != nullptr ) ) {
160160 parentNode->addChild (childTag);
161161 updatedNodeTags_.insert (childTag);
162162 } else {
@@ -173,7 +173,7 @@ void NativeAnimatedNodesManager::connectAnimatedNodeToView(
173173 react_native_assert (viewTag);
174174
175175 auto node = getAnimatedNode<PropsAnimatedNode>(propsNodeTag);
176- if (node) {
176+ if (node != nullptr ) {
177177 node->connectToView (viewTag);
178178 {
179179 std::lock_guard<std::mutex> lock (connectedAnimatedNodesMutex_);
@@ -193,7 +193,7 @@ void NativeAnimatedNodesManager::disconnectAnimatedNodeFromView(
193193 react_native_assert (viewTag);
194194
195195 auto node = getAnimatedNode<PropsAnimatedNode>(propsNodeTag);
196- if (node) {
196+ if (node != nullptr ) {
197197 node->disconnectFromView (viewTag);
198198 {
199199 std::lock_guard<std::mutex> lock (connectedAnimatedNodesMutex_);
@@ -215,7 +215,7 @@ void NativeAnimatedNodesManager::disconnectAnimatedNodes(
215215 auto parentNode = getAnimatedNode<AnimatedNode>(parentTag);
216216 auto childNode = getAnimatedNode<AnimatedNode>(childTag);
217217
218- if (parentNode && childNode) {
218+ if (( parentNode != nullptr ) && ( childNode != nullptr ) ) {
219219 parentNode->removeChild (childTag);
220220 } else {
221221 LOG (WARNING ) << " Cannot DisconnectAnimatedNodes, parentTag = " << parentTag
@@ -326,7 +326,8 @@ void NativeAnimatedNodesManager::addAnimatedEventToView(
326326 }
327327
328328 const auto key = EventAnimationDriverKey{
329- viewTag, EventEmitter::normalizeEventType (eventName)};
329+ .viewTag = viewTag,
330+ .eventName = EventEmitter::normalizeEventType (eventName)};
330331 if (auto driversIter = eventDrivers_.find (key);
331332 driversIter != eventDrivers_.end ()) {
332333 auto & drivers = driversIter->second ;
@@ -345,7 +346,8 @@ void NativeAnimatedNodesManager::removeAnimatedEventFromView(
345346 const std::string& eventName,
346347 Tag animatedValueTag) noexcept {
347348 const auto key = EventAnimationDriverKey{
348- viewTag, EventEmitter::normalizeEventType (eventName)};
349+ .viewTag = viewTag,
350+ .eventName = EventEmitter::normalizeEventType (eventName)};
349351 auto driversIter = eventDrivers_.find (key);
350352 if (driversIter != eventDrivers_.end ()) {
351353 auto & drivers = driversIter->second ;
@@ -376,7 +378,8 @@ void NativeAnimatedNodesManager::handleAnimatedEvent(
376378 bool foundAtLeastOneDriver = false ;
377379
378380 const auto key = EventAnimationDriverKey{
379- viewTag, EventEmitter::normalizeEventType (eventName)};
381+ .viewTag = viewTag,
382+ .eventName = EventEmitter::normalizeEventType (eventName)};
380383 if (auto driversIter = eventDrivers_.find (key);
381384 driversIter != eventDrivers_.end ()) {
382385 auto & drivers = driversIter->second ;
@@ -484,14 +487,15 @@ void NativeAnimatedNodesManager::updateNodes(
484487#endif
485488 const auto connectedToFinishedAnimation =
486489 is_node_connected_to_finished_animation (node, nodeTag, false );
487- nodesQueue.emplace_back (
488- NodesQueueItem{node, connectedToFinishedAnimation});
490+ nodesQueue.emplace_back (NodesQueueItem{
491+ .node = node,
492+ .connectedToFinishedAnimation = connectedToFinishedAnimation});
489493 }
490494 }
491495 }
492496
493497 while (!nodesQueue.empty ()) {
494- auto nextNode = std::move ( nodesQueue.front () );
498+ auto nextNode = nodesQueue.front ();
495499 nodesQueue.pop_front ();
496500 // in Animated, value nodes like RGBA are parents and Color node is child
497501 // (the opposite of tree structure)
@@ -506,8 +510,9 @@ void NativeAnimatedNodesManager::updateNodes(
506510 const auto connectedToFinishedAnimation =
507511 is_node_connected_to_finished_animation (
508512 child, childTag, nextNode.connectedToFinishedAnimation );
509- nodesQueue.emplace_back (
510- NodesQueueItem{child, connectedToFinishedAnimation});
513+ nodesQueue.emplace_back (NodesQueueItem{
514+ .node = child,
515+ .connectedToFinishedAnimation = connectedToFinishedAnimation});
511516 }
512517 }
513518 }
@@ -537,8 +542,9 @@ void NativeAnimatedNodesManager::updateNodes(
537542#endif
538543 const auto connectedToFinishedAnimation =
539544 is_node_connected_to_finished_animation (node, nodeTag, false );
540- nodesQueue.emplace_back (
541- NodesQueueItem{node, connectedToFinishedAnimation});
545+ nodesQueue.emplace_back (NodesQueueItem{
546+ .node = node,
547+ .connectedToFinishedAnimation = connectedToFinishedAnimation});
542548 }
543549 }
544550 }
@@ -548,7 +554,7 @@ void NativeAnimatedNodesManager::updateNodes(
548554 int cyclesDetected = 0 ;
549555#endif
550556 while (!nodesQueue.empty ()) {
551- auto nextNode = std::move ( nodesQueue.front () );
557+ auto nextNode = nodesQueue.front ();
552558 nodesQueue.pop_front ();
553559 if (nextNode.connectedToFinishedAnimation &&
554560 nextNode.node ->type () == AnimatedNodeType::Props) {
@@ -570,8 +576,9 @@ void NativeAnimatedNodesManager::updateNodes(
570576 const auto connectedToFinishedAnimation =
571577 is_node_connected_to_finished_animation (
572578 child, childTag, nextNode.connectedToFinishedAnimation );
573- nodesQueue.emplace_back (
574- NodesQueueItem{child, connectedToFinishedAnimation});
579+ nodesQueue.emplace_back (NodesQueueItem{
580+ .node = child,
581+ .connectedToFinishedAnimation = connectedToFinishedAnimation});
575582 }
576583#ifdef REACT_NATIVE_DEBUG
577584 else if (child->bfsColor == animatedGraphBFSColor_) {
@@ -631,7 +638,8 @@ bool NativeAnimatedNodesManager::onAnimationFrame(double timestamp) {
631638 std::vector<int > finishedAnimations;
632639 for (const auto & [animationId, driver] : activeAnimations_) {
633640 if (driver->getIsComplete ()) {
634- if (getAnimatedNode<ValueAnimatedNode>(driver->getAnimatedValueTag ())) {
641+ if (getAnimatedNode<ValueAnimatedNode>(driver->getAnimatedValueTag ()) !=
642+ nullptr ) {
635643 driver->stopAnimation ();
636644 }
637645 finishedAnimations.emplace_back (animationId);
0 commit comments