# HG changeset patch # User jbe # Date 1381517416 -7200 # Node ID db863178d98b3581e562fbf0bb21cc4f9c8ee086 # Parent 806561cce3b172b6b1fa8db111db94f4a7def311 Algorithm to write "issue_order"."order_in_open_states" diff -r 806561cce3b1 -r db863178d98b lf_update_issue_order.c --- a/lf_update_issue_order.c Fri Oct 11 20:07:41 2013 +0200 +++ b/lf_update_issue_order.c Fri Oct 11 20:50:16 2013 +0200 @@ -88,6 +88,13 @@ struct candidate **candidates; }; +// open issue to be assigned an "order_in_open_states": +struct open_issue { + char *issue_id; + int minimum_position; + int position; +}; + // determine candidate, which is assigned the next seat (starting with the worst rank): static struct candidate *loser(int round_number, struct ballot *ballots, int ballot_count) { int i, j; // index variables for loops @@ -173,7 +180,28 @@ abort(); } -// write results to database: +// calculate "order_in_open_states": +static void calculate_order_in_open_states(struct open_issue *open_issues, int open_issue_count) { + int i, j, fallback_j = 0, fallback_minimum_position; + for (i=1; i<=open_issue_count; i++) { + fallback_minimum_position = -1; + for (j=0; j