From 4b011ec1f3f7810dee013853432d02ee154500a6 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 3 Dec 2007 12:17:26 +0000 Subject: [PATCH] use ngx_rbtree_init() --- src/core/ngx_resolver.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c index 5b4a8bac2..6963acd02 100644 --- a/src/core/ngx_resolver.c +++ b/src/core/ngx_resolver.c @@ -104,17 +104,11 @@ ngx_resolver_create(ngx_peer_addr_t *addr, ngx_log_t *log) return NULL; } - ngx_rbtree_sentinel_init(&r->name_sentinel); + ngx_rbtree_init(&r->name_rbtree, &r->name_sentinel, + ngx_resolver_rbtree_insert_value); - r->name_rbtree.root = &r->name_sentinel; - r->name_rbtree.sentinel = &r->name_sentinel; - r->name_rbtree.insert = ngx_resolver_rbtree_insert_value; - - ngx_rbtree_sentinel_init(&r->addr_sentinel); - - r->addr_rbtree.root = &r->addr_sentinel; - r->addr_rbtree.sentinel = &r->addr_sentinel; - r->addr_rbtree.insert = ngx_rbtree_insert_value; + ngx_rbtree_init(&r->addr_rbtree, &r->addr_sentinel, + ngx_rbtree_insert_value); ngx_queue_init(&r->name_resend_queue); ngx_queue_init(&r->addr_resend_queue);