inpcom.c, cleanup `inp_sort_params()'

This commit is contained in:
rlar 2014-12-14 16:20:53 +01:00
parent aeec110c64
commit 8bf9a67fc8
1 changed files with 6 additions and 14 deletions

View File

@ -3722,22 +3722,14 @@ inp_sort_params(struct line *start_card, struct line *end_card, struct line *car
for (i = 0; i < num_params; i++)
if (!deps[i].skip) {
char *param_name = deps[i].param_name;
for (j = 0; j < num_params; j++) {
// for (j = i + 1; j < num_params; j++) { /* FIXME: to be tested */
if (j == i)
continue;
if (search_plain_identifier(deps[j].param_str, param_name)) {
char *param = deps[i].param_name;
for (j = 0; j < num_params; j++)
if (j != i && search_plain_identifier(deps[j].param_str, param)) {
for (ind = 0; deps[j].depends_on[ind]; ind++)
if (strcmp(param_name, deps[j].depends_on[ind]) == 0)
break;
if (!deps[j].depends_on[ind]) {
deps[j].depends_on[ind++] = param_name;
deps[j].depends_on[ind] = NULL;
}
;
deps[j].depends_on[ind++] = param;
deps[j].depends_on[ind] = NULL;
}
}
}
max_level = 0;