491 |
dict_delete_var (d, *vars++); |
dict_delete_var (d, *vars++); |
492 |
} |
} |
493 |
|
|
494 |
|
/* Deletes scratch variables from dictionary D. */ |
495 |
|
void |
496 |
|
dict_delete_scratch_vars (struct dictionary *d) |
497 |
|
{ |
498 |
|
int i; |
499 |
|
|
500 |
|
/* FIXME: this can be done in O(count) time, but this algorithm |
501 |
|
is O(count**2). */ |
502 |
|
assert (d != NULL); |
503 |
|
|
504 |
|
for (i = 0; i < d->var_cnt; ) |
505 |
|
if (dict_class_from_id (d->var[i]->name) == DC_SCRATCH) |
506 |
|
dict_delete_var (d, d->var[i]); |
507 |
|
else |
508 |
|
i++; |
509 |
|
} |
510 |
|
|
511 |
/* Moves V to 0-based position IDX in D. Other variables in D, |
/* Moves V to 0-based position IDX in D. Other variables in D, |
512 |
if any, retain their relative positions. Runs in time linear |
if any, retain their relative positions. Runs in time linear |
513 |
in the distance moved. */ |
in the distance moved. */ |