Skip to content

Commit

Permalink
Remove now superfluous test for < 0
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jan 25, 2015
1 parent 5dd603b commit 243c164
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/core/Any.pm
Original file line number Diff line number Diff line change
Expand Up @@ -737,14 +737,10 @@ sub SLICE_HUH ( \SELF, @nogo, %a, %adv ) is hidden_from_backtrace {
# internal 1 element hash/array access with adverbs
sub SLICE_ONE ( \SELF, $one, $array, *%adv ) is hidden_from_backtrace {
my $ex;
if $array {
if $one < 0 {
fail X::Subscript::Negative.new(index => $one, type => SELF.WHAT)
}
$ex := SELF.can( 'exists_pos' )[0] if %adv;
}
else {
$ex := SELF.can( 'exists_key' )[0] if %adv;
if %adv {
$ex := $array
?? SELF.can( 'exists_pos' )[0]
!! SELF.can( 'exists_key' )[0];
}

my %a = %adv.clone;
Expand Down

0 comments on commit 243c164

Please sign in to comment.