From: Marius Gavrilescu Date: Wed, 4 Feb 2015 20:43:05 +0000 (+0200) Subject: Make standings DTRT when a contest has no jobs X-Git-Tag: 5999.000_014~86 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=4aa919c4abdc11770c25a8cb078857ac2e2bff08;p=gruntmaster-data.git Make standings DTRT when a contest has no jobs --- diff --git a/lib/Gruntmaster/Data/Result/Contest.pm b/lib/Gruntmaster/Data/Result/Contest.pm index a82bc0f..4ea2f1a 100644 --- a/lib/Gruntmaster/Data/Result/Contest.pm +++ b/lib/Gruntmaster/Data/Result/Contest.pm @@ -235,7 +235,7 @@ sub standings { } } keys %scores; - $st[0]->{rank} = 1; + $st[0]->{rank} = 1 if @st; $st[$_]->{rank} = $st[$_ - 1]->{rank} + ($st[$_]->{score} < $st[$_ - 1]->{score}) for 1 .. $#st; @st }