From: Vincent Pit Date: Tue, 5 Aug 2008 13:26:19 +0000 (+0200) Subject: const ops are always SVOPs, so we can simplify the logic in pp_const X-Git-Tag: v0.02~3 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Nary.git;a=commitdiff_plain;h=097f9bafa7a1857d2798ab96fe54239c7464a97c const ops are always SVOPs, so we can simplify the logic in pp_const --- diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index 427ee8c..707a2e6 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -416,13 +416,12 @@ sub pp_goto { sub pp_const { my ($self, $op) = @_; - if (class($op) eq 'SVOP' and (my $sv = $self->const_sv($op))) { - my $c = class($sv); - if ($c eq 'AV') { - return $sv->FILL + 1; - } elsif ($c eq 'HV') { - return 2 * $sv->FILL; - } + my $sv = $self->const_sv($op); + my $c = class($sv); + if ($c eq 'AV') { + return $sv->FILL + 1; + } elsif ($c eq 'HV') { + return 2 * $sv->FILL; } return 1;