]> git.sur5r.net Git - openldap/commitdiff
Cleanup dup_compare
authorHoward Chu <hyc@openldap.org>
Thu, 6 Dec 2007 16:54:47 +0000 (16:54 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 6 Dec 2007 16:54:47 +0000 (16:54 +0000)
servers/slapd/back-bdb/dn2id.c

index bddbe792830cea410e44daa704d7170462d25322..d4462365ceb8a47e68266bd5e16900c8f5cfc899 100644 (file)
@@ -468,11 +468,11 @@ hdb_dup_compare(
        cn = (diskNode *)curkey->data;
 
        /* data is not aligned, cannot compare directly */
-       ul = un->nrdnlen[0] << 8 | un->nrdnlen[1];
-       cl = cn->nrdnlen[0] << 8 | cn->nrdnlen[1];
+       rc = un->nrdnlen[0] - cn->nrdnlen[0];
+       if ( rc ) return rc;
+       rc = un->nrdnlen[1] - cn->nrdnlen[1];
+       if ( rc ) return rc;
 
-       rc = ul - cl;
-       if( rc ) return rc;
        return strcmp( un->nrdn, cn->nrdn );
 }