Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Streamline IO::ArgFiles.get
  • Loading branch information
lizmat committed Nov 29, 2014
1 parent 0b64cc4 commit 3be8fcd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/core/PIO.pm
Expand Up @@ -27,14 +27,15 @@ my role PIO {
method get(PIO:D:) {
return Str if self.eof;

my Str $x := nqp::p6box_s(nqp::readlinefh($!PIO));
my \line = $!chomp
?? nqp::p6box_s(nqp::readlinefh($!PIO)).chomp
!! nqp::p6box_s(nqp::readlinefh($!PIO));

# XXX don't fail() as long as it's fatal
# fail('end of file') if self.eof && $x eq '';
$x .= chomp if $.chomp;
return Str if self.eof && $x eq '';

return Str if self.eof && line eq '';
$!ins = $!ins + 1;
$x;
line;
}

method getc(PIO:D:) {
Expand Down

0 comments on commit 3be8fcd

Please sign in to comment.