-
- again:
- switch (mtf_compare_BY_values (mtf, min_head, iter, c))
- {
- case -1:
- if (max_head)
- max_tail = max_tail->next_min = iter;
- else
- max_head = max_tail = iter;
- break;
-
- case 0:
- min_tail = min_tail->next_min = iter;
- break;
-
- case 1:
- if (iter->handle == NULL)
- return 1;
- if (sfm_read_case (iter->reader, &iter->input))
- goto again;
- mtf_delete_file_in_place (mtf, &iter);
- break;
-
- default:
- assert (0);
- }
+ for (;;)
+ {
+ int cmp = mtf_compare_BY_values (mtf, min_head, iter, c);
+ if (cmp < 0)
+ {
+ if (max_head)
+ max_tail = max_tail->next_min = iter;
+ else
+ max_head = max_tail = iter;
+ }
+ else if (cmp == 0)
+ min_tail = min_tail->next_min = iter;
+ else /* cmp > 0 */
+ {
+ if (iter->handle == NULL)
+ return 1;
+ if (sfm_read_case (iter->reader, &iter->input))
+ continue;
+ mtf_delete_file_in_place (mtf, &iter);
+ }
+ break;
+ }