diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2006-08-03 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2006-08-03 08:01:00 -0700 |
commit | 103fa22e9ce6ecc0f10fee5dac29726a153b1774 (patch) | |
tree | a98529f19adb68c2059fa9c382853df37c989d0c /src/misc/vec/vecPtr.h | |
parent | 7e8e03206c56e7cd9d0d9fbb447c785c400ff3ee (diff) | |
download | abc-103fa22e9ce6ecc0f10fee5dac29726a153b1774.tar.gz abc-103fa22e9ce6ecc0f10fee5dac29726a153b1774.tar.bz2 abc-103fa22e9ce6ecc0f10fee5dac29726a153b1774.zip |
Version abc60803
Diffstat (limited to 'src/misc/vec/vecPtr.h')
-rw-r--r-- | src/misc/vec/vecPtr.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index f2413703..07ac0f17 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -525,10 +525,18 @@ static inline int Vec_PtrFind( Vec_Ptr_t * p, void * Entry ) static inline void Vec_PtrRemove( Vec_Ptr_t * p, void * Entry ) { int i; + // delete assuming that it is closer to the end + for ( i = p->nSize - 1; i >= 0; i-- ) + if ( p->pArray[i] == Entry ) + break; + assert( i >= 0 ); +/* + // delete assuming that it is closer to the beginning for ( i = 0; i < p->nSize; i++ ) if ( p->pArray[i] == Entry ) break; assert( i < p->nSize ); +*/ for ( i++; i < p->nSize; i++ ) p->pArray[i-1] = p->pArray[i]; p->nSize--; |