Fix-Point commented on code in PR #17784:
URL: https://github.com/apache/nuttx/pull/17784#discussion_r2667183725


##########
sched/hrtimer/hrtimer.h:
##########
@@ -196,10 +196,7 @@ RB_PROTOTYPE(hrtimer_tree_s, hrtimer_node_s, entry, 
hrtimer_compare);
 
 static inline_function bool hrtimer_is_armed(FAR hrtimer_t *hrtimer)
 {
-  /* RB-tree root has NULL parent, so root must be checked explicitly */
-
-  return RB_PARENT(&hrtimer->node, entry) != NULL ||
-         RB_ROOT(&g_hrtimer_tree) == &hrtimer->node;
+  return hrtimer->func != NULL;

Review Comment:
   More conditional branch and coupled with the rb-tree implementation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to