diff --git a/lib/WebGUI/Utility.pm b/lib/WebGUI/Utility.pm index fb384a0af..0862c71ee 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(&randomizeHash &randomizeArray &isInSubnet +our @EXPORT = qw(&randomizeArray &isInSubnet &sortHashDescending &sortHash &isIn &randint &round &scalarEquals ); @@ -41,7 +41,6 @@ This package provides miscellaneous but useful utilities to the WebGUI programme $boolean = isIn($value, @array); $boolean = isInSubnet($ip, \@subnets); $integer = randint($low,$high); - $hashRef = randomizeHash(\%hash); $rounded = round($number, $digits); %hash = sortHash(%hash); %hash = sortHashDescending(%hash); @@ -162,29 +161,6 @@ sub randomizeArray { #------------------------------------------------------------------- -=head2 randomizeHash ( hashRef ) - -Resorts a hash tied to IxHash in random order. Returns a hash reference. - -=head3 hashRef - -A reference hash to randomize. - -=cut - -sub randomizeHash { - my $hash = $_[0]; - my @keys = keys %$hash; - randomizeArray(\@keys); - tie my %temp, 'Tie::IxHash'; - foreach my $key (@keys) { - $temp{$key} = $hash->{$key}; - } - return \%temp; -} - -#------------------------------------------------------------------- - =head2 round ( float [, significantDigits ] ) Returns an integer after rounding a floating point number. diff --git a/t/Utility.t b/t/Utility.t index 18f3b5b3e..f1944b1c2 100644 --- a/t/Utility.t +++ b/t/Utility.t @@ -40,12 +40,6 @@ SKIP: { ok(undef, 'randomizeArray()'); } -# randomizeHash -SKIP: { - skip("Don't know how to test randomizeHash.",1); - ok(undef, 'randomizeHash()'); - } - # 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');