dirty fix bogus bsiter()
This commit is contained in:
parent
06c2e75a76
commit
956154e06e
1 changed files with 3 additions and 2 deletions
|
@ -328,15 +328,16 @@ bsiter(BSet *bs, uint *elt)
|
||||||
{
|
{
|
||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
for (i = *elt; i < bsmax(bs); i++) {
|
for (i=*elt;; i++) {
|
||||||
while (i < bsmax(bs) && !bs->t[i/NBit])
|
while (i < bsmax(bs) && !bs->t[i/NBit])
|
||||||
i = (i + NBit) & -NBit;
|
i = (i + NBit) & -NBit;
|
||||||
|
if (i >= bsmax(bs))
|
||||||
|
return 0;
|
||||||
if (bshas(bs, i)) {
|
if (bshas(bs, i)) {
|
||||||
*elt = i;
|
*elt = i;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Reference in a new issue