diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-08-09 17:53:38 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-08-09 17:53:38 -0700 |
commit | 5b80d704a1f8ce9514b282b9f722b6caa3671d0e (patch) | |
tree | 155267223696d415289290d6a13c98e99ea64656 /src/misc | |
parent | d01c0807bdc2b2d544db96207a129c6eb4e32b5d (diff) | |
download | abc-5b80d704a1f8ce9514b282b9f722b6caa3671d0e.tar.gz abc-5b80d704a1f8ce9514b282b9f722b6caa3671d0e.tar.bz2 abc-5b80d704a1f8ce9514b282b9f722b6caa3671d0e.zip |
Improved abstraction refinement.
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/vec/vecInt.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h index 6988c8ea..a7722866 100644 --- a/src/misc/vec/vecInt.h +++ b/src/misc/vec/vecInt.h @@ -1170,23 +1170,25 @@ static inline void Vec_IntSort( Vec_Int_t * p, int fReverse ) Synopsis [Leaves only unique entries.] - Description [] + Description [Returns the number of duplicated entried found.] SideEffects [] SeeAlso [] ***********************************************************************/ -static inline void Vec_IntUniqify( Vec_Int_t * p ) +static inline int Vec_IntUniqify( Vec_Int_t * p ) { - int i, k; + int i, k, RetValue; if ( p->nSize < 2 ) - return; + return 0; Vec_IntSort( p, 0 ); for ( i = k = 1; i < p->nSize; i++ ) if ( p->pArray[i] != p->pArray[i-1] ) p->pArray[k++] = p->pArray[i]; + RetValue = p->nSize - k; p->nSize = k; + return RetValue; } /**Function************************************************************* |