Skip to content
Snippets Groups Projects
Commit a0bb0d4f authored by Antoine Kryus's avatar Antoine Kryus
Browse files

mod TieBreakFactory() loop order

parent e64233c8
No related branches found
No related tags found
No related merge requests found
......@@ -5,18 +5,20 @@ import (
)
func TieBreakFactory(tieBreakAlts []Alternative) func([]Alternative) (Alternative, error) {
return func(alts []Alternative) (Alternative, error) {
return func(alts []Alternative) (Alternative, error) { // alts est la liste de candidats ex-aequo
if len(alts) == 0 || alts == nil {
return -1, errors.New("002: NullAlternatives")
}
for _, alt := range alts {
for _, tieBreakAlt := range tieBreakAlts {
for _, tieBreakAlt := range tieBreakAlts {
for _, alt := range alts {
if alt == tieBreakAlt {
return alt, nil
}
}
}
rank(tieBreakAlts[0], alts)
return -1, errors.New("002: NoTieBreakAlternativeFound")
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment