liquid_feedback_core

changeset 365:90ac85d184f8

Bugfix in function "process_initiative" of "lf_update_suggestion_order": Reset old_member_id to NULL
author jbe
date Sun Mar 17 12:54:15 2013 +0100 (2013-03-17)
parents 28f860d5dfb4
children 59598477298c
files lf_update_suggestion_order.c
line diff
     1.1 --- a/lf_update_suggestion_order.c	Sun Mar 17 12:20:33 2013 +0100
     1.2 +++ b/lf_update_suggestion_order.c	Sun Mar 17 12:54:15 2013 +0100
     1.3 @@ -278,6 +278,7 @@
     1.4        abort();
     1.5      }
     1.6      ballot = ballots;
     1.7 +    old_member_id = NULL;
     1.8      for (i=0; i<tuple_count; i++) {
     1.9        char *member_id;
    1.10        int weight, preference;
    1.11 @@ -314,8 +315,9 @@
    1.12          }
    1.13        }
    1.14      }
    1.15 +    old_member_id = NULL;
    1.16      ballot = ballots;
    1.17 -    for (i=0; i<=tuple_count; i++) {
    1.18 +    for (i=0; i<tuple_count; i++) {
    1.19        char *member_id, *suggestion_id;
    1.20        int preference;
    1.21        if (i<tuple_count) {
    1.22 @@ -325,13 +327,7 @@
    1.23          preference--;
    1.24          ballot->sections[preference].candidates[candidates_in_sections[preference]++] = candidate_by_key(suggestion_id);
    1.25        }
    1.26 -      if (i==tuple_count || (old_member_id && strcmp(old_member_id, member_id))) {
    1.27 -        ballot++;
    1.28 -        candidates_in_sections[0] = 0;
    1.29 -        candidates_in_sections[1] = 0;
    1.30 -        candidates_in_sections[2] = 0;
    1.31 -        candidates_in_sections[3] = 0;
    1.32 -      }
    1.33 +      if (old_member_id && strcmp(old_member_id, member_id)) ballot++;
    1.34        old_member_id = member_id;
    1.35      }
    1.36    }

Impressum / About Us