mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
perl: make error messages compatible with XS
This commit is contained in:
parent
c320e44a23
commit
f1c294ca50
1 changed files with 2 additions and 2 deletions
|
|
@ -305,10 +305,10 @@ foreach my $pair(
|
|||
sub _unpack {
|
||||
my ( $value ) = @_;
|
||||
# get a header byte
|
||||
my $byte = unpack "x$p C", $value; # "x$p" is faster than substr()
|
||||
defined(my $byte = unpack "x$p C", $value)
|
||||
or Carp::confess("Data::MessagePack->unpack: insufficient bytes");
|
||||
$p++;
|
||||
|
||||
Carp::croak("invalid data") unless defined $byte;
|
||||
|
||||
# +/- fixnum, nil, true, false
|
||||
return $byte2value[$byte] if $typemap[$byte] & $T_DIRECT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue