From dd4f10de57bf7bb48a343686e16aef2bdca5c1c1 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 3 Apr 2002 15:43:41 +0000 Subject: [PATCH] use ber_bvcmp where appropriate --- servers/slapd/back-meta/dncache.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/servers/slapd/back-meta/dncache.c b/servers/slapd/back-meta/dncache.c index b658e964ce..ff8038522e 100644 --- a/servers/slapd/back-meta/dncache.c +++ b/servers/slapd/back-meta/dncache.c @@ -99,12 +99,10 @@ meta_dncache_cmp( struct metadncacheentry *cc1 = ( struct metadncacheentry * )c1; struct metadncacheentry *cc2 = ( struct metadncacheentry * )c2; - int d = cc1->dn.bv_len - cc2->dn.bv_len; - /* * case sensitive, because the dn MUST be normalized */ - return d != 0 ? d : strcmp( cc1->dn.bv_val, cc2->dn.bv_val ); + return ber_bvcmp( &cc1->dn, &cc2->dn); } /* @@ -122,15 +120,10 @@ meta_dncache_dup( struct metadncacheentry *cc1 = ( struct metadncacheentry * )c1; struct metadncacheentry *cc2 = ( struct metadncacheentry * )c2; - int d = cc1->dn.bv_len - cc2->dn.bv_len; - int cmp; - /* * case sensitive, because the dn MUST be normalized */ - cmp = d != 0 ? d : strcmp( cc1->dn.bv_val, cc2->dn.bv_val ); - - return ( cmp == 0 ) ? -1 : 0; + return ( ber_bvcmp( &cc1->dn, &cc2->dn ) == 0 ) ? -1 : 0; } /* -- 2.39.5