summaryrefslogtreecommitdiff
path: root/wk3/pset
diff options
context:
space:
mode:
Diffstat (limited to 'wk3/pset')
-rw-r--r--wk3/pset/runoff/runoff.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/wk3/pset/runoff/runoff.c b/wk3/pset/runoff/runoff.c
index a959a2c..0e05e15 100644
--- a/wk3/pset/runoff/runoff.c
+++ b/wk3/pset/runoff/runoff.c
@@ -146,16 +146,10 @@ void tabulate(void)
// Query for each rank
for (int j = 0; j < candidate_count; j++)
{
- for (int k = 0; k < candidate_count; k++)
- {
- if (!strcmp(preferences[i][j], candidates[k].name))
+ if (!candidates[preferences[i][j]].eliminated)
{
- if (!candidates[k].eliminated)
- {
- candidates[k].votes++;
- }
+ candidates[preferences[i][j]].votes++;
}
- }
}
}
return;