Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Performance and stability fix... Reduces the possibility of a heap co…
…rruption until the 200k list on my machine
  • Loading branch information
azawawi committed Nov 3, 2017
1 parent 2173a0c commit ef0d5ba
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/MsgPack/Packer.pm6
Expand Up @@ -19,15 +19,14 @@ method pack( $data ) returns Blob

self._pack($data);

my @packed = gather {
for 0..($.sbuf.size - 1) {
take 0xff +& $.sbuf.data[$_];
}
}
my $packed;
my $size = $.sbuf.size;
my $buffer = $.sbuf.data;
$packed.append($buffer[$_]) for ^$size;

msgpack_sbuffer_destroy($.sbuf);

return Blob.new(@packed);
return Blob.new($packed);
}

multi method _pack(List:D $list) {
Expand Down

0 comments on commit ef0d5ba

Please sign in to comment.