summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2014-03-22 15:54:41 +0100
committerTony Cook <tony@develop-help.com>2014-05-28 13:29:06 +1000
commitbd47baf274ecea5636da37b74e4368e6f271fed5 (patch)
tree44bf14e8e8503ff52121a304b8687840c13fe45e /pp_sys.c
parent725995b4682495a83cf4d8d7eeb037b9cb950d65 (diff)
downloadperl-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 0541a72c1d..671a9c0de0 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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 */