Skip to content

Commit

Permalink
nicer inverse_index algorithm
Browse files Browse the repository at this point in the history
moritz++
  • Loading branch information
Carl Masak committed Jul 24, 2011
1 parent 68f8677 commit 1b572f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ (Direction $d)
}

sub inverse_index(@array, $value) {
my $index = (first { .value eq $value }, @array.pairs).key;
my $index = @array.keys.first({ @array[$_] eq $value });
return $index;
}

Expand Down

0 comments on commit 1b572f6

Please sign in to comment.