mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-08 10:49:59 +00:00
perl: modified trivial codes in PP::Unpacker
This commit is contained in:
parent
ead8edc7cd
commit
6d9a629b15
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue