pointer-set.h (pointer_set_contains): Remove.
* pointer-set.h (pointer_set_contains): Remove. * pointer-set.c (pointer_set_contains): Likewise. From-SVN: r91040
This commit is contained in:
parent
d0d2cc2105
commit
515a179197
@ -1,3 +1,8 @@
|
||||
2004-11-23 Ben Elliston <bje@au.ibm.com>
|
||||
|
||||
* pointer-set.h (pointer_set_contains): Remove.
|
||||
* pointer-set.c (pointer_set_contains): Likewise.
|
||||
|
||||
2004-11-22 Dale Johannesen <dalej@apple.com>
|
||||
|
||||
* calls.c (expand_call): Do not call preserve_temp_slots.
|
||||
|
@ -90,31 +90,6 @@ void pointer_set_destroy (struct pointer_set_t *pset)
|
||||
XDELETE (pset);
|
||||
}
|
||||
|
||||
/* Returns nonzero if PSET contains P. P must be nonnull.
|
||||
|
||||
Collisions are resolved by linear probing. More complicated
|
||||
collision management schemes are only useful when the load factor
|
||||
significantly exceeds 0.5, and we never let that happen. */
|
||||
int
|
||||
pointer_set_contains (struct pointer_set_t *pset, void *p)
|
||||
{
|
||||
size_t n = hash1 (p, pset->n_slots, pset->log_slots);
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (pset->slots[n] == p)
|
||||
return 1;
|
||||
else if (pset->slots[n] == 0)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
++n;
|
||||
if (n == pset->n_slots)
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Subroutine of pointer_set_insert. Inserts P into an empty
|
||||
element of SLOTS, an array of length N_SLOTS. Returns nonzero
|
||||
if P was already present in N_SLOTS. */
|
||||
|
@ -26,7 +26,6 @@ struct pointer_set_t;
|
||||
struct pointer_set_t *pointer_set_create (void);
|
||||
void pointer_set_destroy (struct pointer_set_t *pset);
|
||||
|
||||
int pointer_set_contains (struct pointer_set_t *pset, void *p);
|
||||
int pointer_set_insert (struct pointer_set_t *pset, void *p);
|
||||
|
||||
#endif /* POINTER_SET_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user