diff --git a/runoff.c b/runoff.c index 66cb6cb..40a8ced 100644 --- a/runoff.c +++ b/runoff.c @@ -188,16 +188,20 @@ int find_min(void) // Return true if the election is tied between all candidates, false otherwise bool is_tie(int min) { - int match = 0; + bool tie = false; for (int i = 0; i < candidate_count; i++) { if (candidates[i].votes == min && !candidates[i].eliminated) { - match++; + tie = true;; + } + else if (candidates[i].votes != min && !candidates[i].eliminated) + { + tie = false; } } - if (match > 1) + if (tie == true) { return true; }