commit 998ff57f4f4e054903fda595b99c7154510f6d3f from: Stefan Sperling date: Sun Nov 18 23:22:17 2018 UTC make advance_branch() search the smaller id set first commit - 9f57848c05f3609670a9890cf40c27c72fbc8e94 commit + 998ff57f4f4e054903fda595b99c7154510f6d3f blob - 642532112a140b677184b1aa43790b0ce718cd40 blob + 02c170d983d89a460edddc640f4bbe73be8844a3 --- lib/commit_graph.c +++ lib/commit_graph.c @@ -306,20 +306,20 @@ advance_branch(struct got_commit_graph *graph, qid = SIMPLEQ_FIRST(&commit->parent_ids); if (qid == NULL) return NULL; - if (got_object_idset_get(graph->node_ids, qid->id)) - return NULL; /* parent already traversed */ if (got_object_idset_get(graph->open_branches, qid->id)) return NULL; + if (got_object_idset_get(graph->node_ids, qid->id)) + return NULL; /* parent already traversed */ return got_object_idset_add(graph->open_branches, qid->id, node); } } SIMPLEQ_FOREACH(qid, &commit->parent_ids, entry) { - if (got_object_idset_get(graph->node_ids, qid->id)) - continue; /* parent already traversed */ if (got_object_idset_get(graph->open_branches, qid->id)) continue; + if (got_object_idset_get(graph->node_ids, qid->id)) + continue; /* parent already traversed */ err = got_object_idset_add(graph->open_branches, qid->id, node); if (err) return err;