Skip to content

Commit

Permalink
Let IO::CatHandle.slurp pass on :bin
Browse files Browse the repository at this point in the history
Fixes R#3566
  • Loading branch information
lizmat committed Mar 23, 2020
1 parent 1355924 commit 42c4c3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core.c/IO/CatHandle.pm6
Expand Up @@ -284,16 +284,16 @@ my class IO::CatHandle is IO::Handle {
'')
}

method slurp (::?CLASS:D:) {
method slurp (::?CLASS:D: :$bin) {
# we don't take a :close arg, because we close exhausted handles
# and .slurp isn't lazy, so all handles will get exhausted
nqp::if(
nqp::defined($!active-handle),
([~] gather nqp::stmts( # the [~] takes care of both Str and Blobs
(take $!active-handle.slurp),
(take $!active-handle.slurp(:$bin)),
nqp::while(
nqp::defined(self.next-handle),
take $!active-handle.slurp))),
take $!active-handle.slurp(:$bin)))),
Nil)
}
method slurp-rest (|) {
Expand Down

0 comments on commit 42c4c3f

Please sign in to comment.