in reply to How can I improve the efficiency of this very intensive code?
sub IsStrongMatch { # Return true if id2 is only top ranked match for id1 my $id1 = shift; my $id2 = shift; my $rC = shift; for my $i1 ( keys %{$rC} ) { next if $i1 == $id1; foreach my $i2 ( sort { $rC->{$i1}->{$a} <=> $rC->{$i1}->{$b} +} keys %{$rC->{$i1}} ) { if ( $id2 == $i2 ) { return 0; } last; } } return 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I improve the efficiency of this very intensive code?
by EvanCarroll (Chaplain) on Aug 06, 2005 at 22:33 UTC | |
by mrborisguy (Hermit) on Aug 06, 2005 at 23:16 UTC | |
by polettix (Vicar) on Aug 07, 2005 at 00:07 UTC | |
by clearcache (Beadle) on Aug 06, 2005 at 22:37 UTC |