Skip to content

Commit

Permalink
[Buf] remove append_inplace hack; ordinary concatenation performs nea…
Browse files Browse the repository at this point in the history
…rly equally well, so this was a case of premature optimization. Go figure.
  • Loading branch information
moritz committed Sep 22, 2011
1 parent 8943be1 commit 943dcd1
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/core/Buf.pm
Expand Up @@ -49,18 +49,6 @@ class Buf does Positional {
nqp::unbox_s $encoding.lc
);
}

# append_inplace is a big hack, but seems to be necessary
# performance wise for reading binary data in chunks
method append_inplace(Buf:D: Buf:D $other) {
my Mu $other_buf := nqp::getattr(pir::perl6_decontainerize__PP($other), Buf, '$!buffer');
pir::set__vPs($!buffer, nqp::concat_s(
$!buffer.get_string('binary'),
$other_buf.get_string('binary')
)
);
self;
}
}

multi infix:<eqv>(Buf:D $a, Buf:D $b) {
Expand Down

0 comments on commit 943dcd1

Please sign in to comment.