History

timerqueue: Use rb_entry_safe() instead of open-coding it

Geliang Tang committed 9 years ago

Commit d852d391 parent 9e3d6221 file · +1 −2Browse files

Showing the changes to lib/timerqueue.c (1 of 1 file). Show all

Unified · Split

lib/timerqueue.c+1−2
@@ -80,8 +80,7 @@ bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node) · 79 unmodified lines
80 if (head->next == node) {80 if (head->next == node) {
81 struct rb_node *rbn = rb_next(&node->node);81 struct rb_node *rbn = rb_next(&node->node);
82 82
83 head->next = rbn ?83 head->next = rb_entry_safe(rbn, struct timerqueue_node, node);
84 rb_entry(rbn, struct timerqueue_node, node) : NULL;
85 }84 }
86 rb_erase(&node->node, &head->head);85 rb_erase(&node->node, &head->head);
87 RB_CLEAR_NODE(&node->node);86 RB_CLEAR_NODE(&node->node);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t