From c1132e42982bfc6f1239f887a2393ab3fd8c4a55 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 20 Aug 2010 12:43:40 -0500 Subject: [PATCH] remove WebGUI::Utility::randomizeArray --- lib/WebGUI/Utility.pm | 21 +-------------------- t/Utility.t | 6 ------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/lib/WebGUI/Utility.pm b/lib/WebGUI/Utility.pm index 0862c71ee..b2543a39a 100644 --- a/lib/WebGUI/Utility.pm +++ b/lib/WebGUI/Utility.pm @@ -22,7 +22,7 @@ use Tie::IxHash; use Net::CIDR::Lite; our @ISA = qw(Exporter); -our @EXPORT = qw(&randomizeArray &isInSubnet +our @EXPORT = qw(&isInSubnet &sortHashDescending &sortHash &isIn &randint &round &scalarEquals ); @@ -142,25 +142,6 @@ sub randint { #------------------------------------------------------------------- -=head2 randomizeArray ( ) - -Don't use this function, it is depricated and will be removed at some point in the future. Instead use List::Util::shuffle() - -=cut - -sub randomizeArray { - my $array = shift; - if ($#$array > 0) { - for (my $i = @$array; --$i; ) { - my $j = int rand ($i+1); - next if $i == $j; - @$array[$i,$j] = @$array[$j,$i]; - } - } -} - -#------------------------------------------------------------------- - =head2 round ( float [, significantDigits ] ) Returns an integer after rounding a floating point number. diff --git a/t/Utility.t b/t/Utility.t index f1944b1c2..4a240d3f4 100644 --- a/t/Utility.t +++ b/t/Utility.t @@ -34,12 +34,6 @@ ok($number >= 0 && $number <= 1, 'randint() with default params'); my $number = WebGUI::Utility::randint(10,5); ok($number >= 5 && $number <= 10, 'randint() auto reverses params if they are backwards'); -# randomizeArray -SKIP: { - skip("Don't know how to test randomizeArray.",1); - ok(undef, 'randomizeArray()'); - } - # round is(WebGUI::Utility::round(47.133984233, 0), 47, 'round() - 0 significant digits'); is(WebGUI::Utility::round(47.133984233, 3), 47.134, 'round() - multiple significant digits');