mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Eliminate a bubble move.
This commit is contained in:
parent
e766d2c568
commit
5ecf77c034
@ -647,16 +647,9 @@ idl_insert( ID_BLOCK **idl, ID id, unsigned int maxids )
|
|||||||
(ID_BLOCK_NMAX(*idl) + ID_BLOCK_IDS_OFFSET) * sizeof(ID) );
|
(ID_BLOCK_NMAX(*idl) + ID_BLOCK_IDS_OFFSET) * sizeof(ID) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make a slot for the new id *//* XXX bubble move XXX */
|
/* make a slot for the new id */
|
||||||
#define BUBBLE 1
|
|
||||||
#ifdef BUBBLE
|
|
||||||
for ( j = ID_BLOCK_NIDS(*idl); j != i; j-- ) {
|
|
||||||
ID_BLOCK_ID(*idl, j) = ID_BLOCK_ID(*idl, j-1);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
SAFEMEMCPY( &ID_BLOCK_ID(*idl, i), &ID_BLOCK_ID(*idl, i+1),
|
SAFEMEMCPY( &ID_BLOCK_ID(*idl, i), &ID_BLOCK_ID(*idl, i+1),
|
||||||
ID_BLOCK_NIDS(*idl) - i );
|
ID_BLOCK_NIDS(*idl) - i );
|
||||||
#endif
|
|
||||||
|
|
||||||
ID_BLOCK_ID(*idl, i) = id;
|
ID_BLOCK_ID(*idl, i) = id;
|
||||||
ID_BLOCK_NIDS(*idl)++;
|
ID_BLOCK_NIDS(*idl)++;
|
||||||
|
Loading…
Reference in New Issue
Block a user