From: Pierangelo Masarati Date: Tue, 2 Apr 2002 11:41:56 +0000 (+0000) Subject: use ber_bvcmp() whenever possible X-Git-Tag: OPENLDAP_REL_ENG_2_MP~269 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7b2f5f0da7cabd2b2431f15909d612fc1be5da6d;p=openldap use ber_bvcmp() whenever possible --- diff --git a/servers/slapd/back-monitor/cache.c b/servers/slapd/back-monitor/cache.c index 6572c2af2e..e55931b118 100644 --- a/servers/slapd/back-monitor/cache.c +++ b/servers/slapd/back-monitor/cache.c @@ -51,12 +51,10 @@ monitor_cache_cmp( struct monitorcache *cc1 = ( struct monitorcache * )c1; struct monitorcache *cc2 = ( struct monitorcache * )c2; - int d = cc1->mc_ndn->bv_len - cc2->mc_ndn->bv_len; - /* * case sensitive, because the dn MUST be normalized */ - return d != 0 ? d : strcmp( cc1->mc_ndn->bv_val, cc2->mc_ndn->bv_val ); + return ber_bvcmp( cc1->mc_ndn, cc2->mc_ndn ); } /* @@ -71,19 +69,10 @@ monitor_cache_dup( struct monitorcache *cc1 = ( struct monitorcache * )c1; struct monitorcache *cc2 = ( struct monitorcache * )c2; - /* * case sensitive, because the dn MUST be normalized */ -#if 0 - int cmp = monitor_cache_cmp( c1, c2 ); -#else - int d = cc1->mc_ndn->bv_len - cc2->mc_ndn->bv_len; - int cmp = - d != 0 ? d : strcmp( cc1->mc_ndn->bv_val, cc2->mc_ndn->bv_val ); -#endif - - return cmp == 0 ? -1 : 0; + return ber_bvcmp( cc1->mc_ndn, cc2->mc_ndn ) == 0 ? -1 : 0; } /*