68 |
|
int upper, lower; |
69 |
|
register int cm, i; |
70 |
|
|
71 |
+ |
if ((i = os[0]) <= 6) { /* linear search algorithm */ |
72 |
+ |
cm = obj; |
73 |
+ |
while (i-- > 0) |
74 |
+ |
if (*++os == cm) |
75 |
+ |
return(1); |
76 |
+ |
return(0); |
77 |
+ |
} |
78 |
|
lower = 1; |
79 |
< |
upper = cm = os[0] + 1; |
79 |
> |
upper = cm = i + 1; |
80 |
|
/* binary search algorithm */ |
81 |
|
while ((i = (lower + upper) >> 1) != cm) { |
82 |
|
cm = obj - os[i]; |
235 |
|
|
236 |
|
if (!isfull(ot)) |
237 |
|
goto noderr; |
238 |
< |
i = oseti(ot); |
239 |
< |
if ((os = ostable[i%OSTSIZ]) == NULL) |
238 |
> |
ot = oseti(ot); |
239 |
> |
if ((os = ostable[ot%OSTSIZ]) == NULL) |
240 |
|
goto noderr; |
241 |
< |
for (i /= OSTSIZ; i--; os += *os + 1) |
241 |
> |
for (i = ot/OSTSIZ; i--; os += *os + 1) |
242 |
|
if (*os <= 0) |
243 |
|
goto noderr; |
244 |
|
for (i = *os; i-- >= 0; ) /* copy set here */ |