This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 26a8fab71d63d4e0e1f8061a9edf77c10ed05bd4 Author: Kevin Morin <morin@codelutin.com> Date: Mon Sep 11 16:35:51 2017 +0200 correction du dépouillement du vote alternatif (problème si des candidats n'ont aucun vote premier) --- .../votecounting/InstantRunoffVoteCountingStrategy.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCountingStrategy.java b/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCountingStrategy.java index 60c23520..ed08962a 100644 --- a/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCountingStrategy.java +++ b/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCountingStrategy.java @@ -194,20 +194,11 @@ public class InstantRunoffVoteCountingStrategy extends AbstractVoteCountingStrat results.add(resultByChoice.get(id)); } - results.sort(Comparator.comparing(ChoiceScore::getScoreValue, Comparator.nullsLast(Comparator.naturalOrder()))); + results.sort(Comparator.comparing(ChoiceScore::getScoreValue, Comparator.nullsFirst(Comparator.naturalOrder()))); // on supprime tout score à 0 - Iterator<ChoiceScore> itr = results.iterator(); - while (itr.hasNext()) { - ChoiceScore choiceScore = itr.next(); - if (choiceScore.getScoreValue() == null || - ZERO_D.equals(choiceScore.getScoreValue())) { - itr.remove(); - } else { - // score > 0 on peut s'arreter - break; - } - } + results.removeIf(choiceScore -> choiceScore.getScoreValue() == null + || ZERO_D.equals(choiceScore.getScoreValue())); return results; } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.