[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] another Redux / Re-ducks



Before

    my %cc = $GTD_Policy->cc_methods(lang_code=>$lang_code);
    my @s_cc = sort{$cc{$a} cmp $cc{$b}} keys %cc;
    foreach my $cc_type (sort @s_cc) {
      push @arr, { code=>$cc_type, desc=>$cc{$cc_type} };
    }

After

    my %cc = $GTD_Policy->cc_methods(lang_code=>$lang_code);
    foreach my $cc_type (sort keys %cc) {
      push @arr, { code=>$cc_type, desc=>$cc{$cc_type} };
    }


Looks like the first sort intended to sort the keys based on the values,
but then that second sort was throwing all that hard work away...

?

j