diff options
author | Niels Thykier <niels@thykier.net> | 2014-03-22 15:54:41 +0100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2014-05-28 13:29:06 +1000 |
commit | bd47baf274ecea5636da37b74e4368e6f271fed5 (patch) | |
tree | 44bf14e8e8503ff52121a304b8687840c13fe45e /pp_sys.c | |
parent | 725995b4682495a83cf4d8d7eeb037b9cb950d65 (diff) | |
download | perl-bd47baf274ecea5636da37b74e4368e6f271fed5.tar.gz |
pp_sys.c: Optimize out a call to PerlIO_get_cnt
If PerlIO_getc returns EOF, PerlIO_get_cnt is not going to return a
positive value all of a sudden.
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -3322,9 +3322,10 @@ PP(pp_fttext) i = PerlIO_getc(IoIFP(io)); if (i != EOF) (void)PerlIO_ungetc(IoIFP(io),i); + else + /* null file is anything */ + FT_RETURNYES; } - if (PerlIO_get_cnt(IoIFP(io)) <= 0) /* null file is anything */ - FT_RETURNYES; len = PerlIO_get_bufsiz(IoIFP(io)); s = (STDCHAR *) PerlIO_get_base(IoIFP(io)); /* sfio can have large buffers - limit to 512 */ |