mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-07 14:18:15 +08:00
Misc cleanup of asserts
This commit is contained in:
parent
92ec77f6dc
commit
d4df1af590
@ -132,13 +132,13 @@ int octetStringIndexer(
|
||||
digest.bv_val = HASHdigest;
|
||||
digest.bv_len = sizeof(HASHdigest);
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( values != NULL && values[0] != NULL );
|
||||
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
/* just count them */
|
||||
}
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( i > 0 );
|
||||
|
||||
keys = ch_malloc( sizeof( struct berval * ) * (i+1) );
|
||||
|
||||
slen = strlen( syntax->ssyn_oid );
|
||||
@ -853,7 +853,6 @@ approxIndexer(
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
approxFilter(
|
||||
slap_mask_t use,
|
||||
@ -968,8 +967,10 @@ approxIndexer(
|
||||
char *s;
|
||||
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
/* just count them */
|
||||
/* empty - just count them */
|
||||
}
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( i > 0 );
|
||||
|
||||
keys = (struct berval **)ch_malloc( sizeof( struct berval * ) * (i+1) );
|
||||
@ -1204,13 +1205,13 @@ int caseExactIndexer(
|
||||
digest.bv_val = HASHdigest;
|
||||
digest.bv_len = sizeof(HASHdigest);
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( values != NULL && values[0] != NULL );
|
||||
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
/* just count them */
|
||||
/* empty - just count them */
|
||||
}
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( i > 0 );
|
||||
|
||||
keys = ch_malloc( sizeof( struct berval * ) * (i+1) );
|
||||
|
||||
slen = strlen( syntax->ssyn_oid );
|
||||
@ -1320,15 +1321,15 @@ int caseExactSubstringsIndexer(
|
||||
digest.bv_val = HASHdigest;
|
||||
digest.bv_len = sizeof(HASHdigest);
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( values != NULL && values[0] != NULL );
|
||||
|
||||
nkeys=0;
|
||||
|
||||
/* create normalized copy of values */
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
/* empty */
|
||||
/* empty - just count them */
|
||||
}
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( i > 0 );
|
||||
|
||||
nvalues = ch_malloc( sizeof( struct berval * ) * (i+1) );
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
nvalues[i] = ber_bvstr( UTF8normalize( values[i]->bv_val,
|
||||
@ -1829,13 +1830,13 @@ int caseIgnoreIndexer(
|
||||
digest.bv_val = HASHdigest;
|
||||
digest.bv_len = sizeof(HASHdigest);
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( values != NULL && values[0] != NULL );
|
||||
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
/* just count them */
|
||||
/* empty - just count them */
|
||||
}
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( i > 0 );
|
||||
|
||||
keys = ch_malloc( sizeof( struct berval * ) * (i+1) );
|
||||
|
||||
slen = strlen( syntax->ssyn_oid );
|
||||
@ -1944,15 +1945,15 @@ int caseIgnoreSubstringsIndexer(
|
||||
digest.bv_val = HASHdigest;
|
||||
digest.bv_len = sizeof(HASHdigest);
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( values != NULL && values[0] != NULL );
|
||||
|
||||
nkeys=0;
|
||||
|
||||
/* create normalized copy of values */
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
/* empty */
|
||||
/* empty - just count them */
|
||||
}
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( i > 0 );
|
||||
|
||||
nvalues = ch_malloc( sizeof( struct berval * ) * (i+1) );
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
nvalues[i] = ber_bvstr( UTF8normalize( values[i]->bv_val,
|
||||
@ -2674,13 +2675,13 @@ int caseExactIA5Indexer(
|
||||
digest.bv_val = HASHdigest;
|
||||
digest.bv_len = sizeof(HASHdigest);
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( values != NULL && values[0] != NULL );
|
||||
|
||||
for( i=0; values[i] != NULL; i++ ) {
|
||||
/* just count them */
|
||||
/* empty - just count them */
|
||||
}
|
||||
|
||||
/* we should have at least one value at this point */
|
||||
assert( i > 0 );
|
||||
|
||||
keys = ch_malloc( sizeof( struct berval * ) * (i+1) );
|
||||
|
||||
slen = strlen( syntax->ssyn_oid );
|
||||
|
Loading…
Reference in New Issue
Block a user