perl: modified trivial codes in PP::Unpacker

This commit is contained in:
makamaka
2010-09-22 14:19:09 +09:00
parent ead8edc7cd
commit 6d9a629b15

View File

@@ -419,7 +419,7 @@ sub execute {
$p = 0; $p = 0;
LOOP: while ( length($self->{data}) > $p ) { while ( length($self->{data}) > $p ) {
_count( $self, $self->{data} ) or last; _count( $self, $self->{data} ) or last;
while ( @{ $self->{stack} } > 0 && --$self->{stack}->[-1] == 0) { while ( @{ $self->{stack} } > 0 && --$self->{stack}->[-1] == 0) {
@@ -428,7 +428,7 @@ sub execute {
if (@{$self->{stack}} == 0) { if (@{$self->{stack}} == 0) {
$self->{is_finished}++; $self->{is_finished}++;
last LOOP; last;
} }
} }
$self->{pos} = $p; $self->{pos} = $p;
@@ -455,7 +455,7 @@ sub _count {
$num = $byte & ~0x90; $num = $byte & ~0x90;
} }
if (defined($num) && $num > 0) { if ( $num ) {
push @{ $self->{stack} }, $num + 1; push @{ $self->{stack} }, $num + 1;
} }
@@ -476,7 +476,7 @@ sub _count {
$num = $byte & ~0x80; $num = $byte & ~0x80;
} }
if ($num > 0) { if ( $num ) {
push @{ $self->{stack} }, $num * 2 + 1; # a pair push @{ $self->{stack} }, $num * 2 + 1; # a pair
} }