Implement set_is_member.

Oops, forgot that one.
This commit is contained in:
Bill Currie 2012-10-30 19:58:19 +09:00
parent 7853bf1859
commit d2fab28d01

View file

@ -235,3 +235,11 @@ set_is_subset (const set_t *set, const set_t *sub)
return 0;
return 1;
}
int
set_is_member (const set_t *set, unsigned x)
{
if (x >= set->size)
return 0;
return (set->map[x / BITS] & (1 << (x % BITS))) != 0;
}