Fixed a bug where having poll with no answers would cause the poll wobject to crash.

Fixed a bug where the reset votes option in the poll would become mangled if the anti-caching mechanism was enabled.
This commit is contained in:
JT Smith 2002-08-23 02:11:38 +00:00
parent 9eae4862e0
commit d3446049d3
2 changed files with 7 additions and 5 deletions

View file

@ -58,10 +58,12 @@ sub randint {
sub randomizeArray {
my ($array, $i, $j);
$array = shift;
for ($i = @$array; --$i; ) {
$j = int rand ($i+1);
next if $i == $j;
@$array[$i,$j] = @$array[$j,$i];
if ($#$array > 0) {
for ($i = @$array; --$i; ) {
$j = int rand ($i+1);
next if $i == $j;
@$array[$i,$j] = @$array[$j,$i];
}
}
}