xiaoxiang781216 commented on code in PR #17784:
URL: https://github.com/apache/nuttx/pull/17784#discussion_r2668687699
##########
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:
for list, you can do the similar check too.
BTW, the new design change func every time, which reduce hrtimer_start
performance too.
--
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]