sortbydeps: rename found -> switched_to_child

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
This commit is contained in:
Andrew Gregory 2017-04-15 17:28:37 -04:00
parent 098e114f58
commit a8670304c9

View file

@ -231,19 +231,19 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle,
while(vptr) { while(vptr) {
/* mark that we touched the vertex */ /* mark that we touched the vertex */
vertex->state = ALPM_GRAPH_STATE_PROCESSING; vertex->state = ALPM_GRAPH_STATE_PROCESSING;
int found = 0; int switched_to_child = 0;
while(vertex->iterator && !found) { while(vertex->iterator && !switched_to_child) {
alpm_graph_t *nextchild = vertex->iterator->data; alpm_graph_t *nextchild = vertex->iterator->data;
vertex->iterator = vertex->iterator->next; vertex->iterator = vertex->iterator->next;
if(nextchild->state == ALPM_GRAPH_STATE_UNPROCESSED) { if(nextchild->state == ALPM_GRAPH_STATE_UNPROCESSED) {
found = 1; switched_to_child = 1;
nextchild->parent = vertex; nextchild->parent = vertex;
vertex = nextchild; vertex = nextchild;
} else if(nextchild->state == ALPM_GRAPH_STATE_PROCESSING) { } else if(nextchild->state == ALPM_GRAPH_STATE_PROCESSING) {
_alpm_warn_dep_cycle(handle, targets, vertex, nextchild, reverse); _alpm_warn_dep_cycle(handle, targets, vertex, nextchild, reverse);
} }
} }
if(!found) { if(!switched_to_child) {
if(alpm_list_find_ptr(targets, vertex->data)) { if(alpm_list_find_ptr(targets, vertex->data)) {
newtargs = alpm_list_add(newtargs, vertex->data); newtargs = alpm_list_add(newtargs, vertex->data);
} }