summaryrefslogtreecommitdiff
path: root/wk3/pset/runoff
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-19 22:08:32 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-02-19 22:08:32 +0000
commit1babf8a7891a57e72803e7e7c61fe5c2e1d7b226 (patch)
treefc7cb222d16b758ed94b53f03ec46f1eefaf6eea /wk3/pset/runoff
parent65850db3203ca210ea5dde2475c7ed361934b36c (diff)
Mon, Feb 19, 2024, 2:08 PM -08:00
Diffstat (limited to 'wk3/pset/runoff')
-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;