mirror of
https://github.com/nginx/nginx.git
synced 2024-12-12 18:29:00 +08:00
make global the rbtree color handling macros
This commit is contained in:
parent
6a23cf06e8
commit
618dc75c2d
@ -13,12 +13,6 @@
|
||||
* the "Introduction to Algorithms" by Cormen, Leiserson and Rivest.
|
||||
*/
|
||||
|
||||
#define ngx_rbt_red(node) ((node)->color = 1)
|
||||
#define ngx_rbt_black(node) ((node)->color = 0)
|
||||
#define ngx_rbt_is_red(node) ((node)->color)
|
||||
#define ngx_rbt_is_black(node) (!ngx_rbt_is_red(node))
|
||||
#define ngx_rbt_copy_color(n1, n2) (n1->color = n2->color)
|
||||
|
||||
|
||||
static ngx_inline void ngx_rbtree_left_rotate(ngx_rbtree_node_t **root,
|
||||
ngx_rbtree_node_t *sentinel, ngx_rbtree_node_t *node);
|
||||
|
@ -50,9 +50,16 @@ void ngx_rbtree_insert_timer_value(ngx_rbtree_node_t *root,
|
||||
ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
|
||||
|
||||
|
||||
#define ngx_rbt_red(node) ((node)->color = 1)
|
||||
#define ngx_rbt_black(node) ((node)->color = 0)
|
||||
#define ngx_rbt_is_red(node) ((node)->color)
|
||||
#define ngx_rbt_is_black(node) (!ngx_rbt_is_red(node))
|
||||
#define ngx_rbt_copy_color(n1, n2) (n1->color = n2->color)
|
||||
|
||||
|
||||
/* a sentinel must be black */
|
||||
|
||||
#define ngx_rbtree_sentinel_init(node) node->color = 0
|
||||
#define ngx_rbtree_sentinel_init(node) ngx_rbt_black(node)
|
||||
|
||||
|
||||
static ngx_inline ngx_rbtree_node_t *
|
||||
|
Loading…
Reference in New Issue
Block a user