-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] Optimize out a call to PerlIO_get_cnt in pp_fttext #13686
Comments
From @nthykierCreated by @nthykierPerl Info
|
From @nthykier0001-pp_sys.c-Optimize-out-a-call-to-PerlIO_get_cnt.patchFrom f7894fadda3f53bccbfb9beb64476389311253c8 Mon Sep 17 00:00:00 2001
From: Niels Thykier <niels@thykier.net>
Date: Sat, 22 Mar 2014 15:54:41 +0100
Subject: [PATCH] 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>
---
pp_sys.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pp_sys.c b/pp_sys.c
index 9f97177..07a0941 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 */
--
1.9.0
|
From @khwilliamsonOn 03/22/2014 09:51 AM, niels@thykier.net (via RT) wrote:
Thanks! I will apply this in 5.21 after the code base reopens for general |
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10On Sat, Mar 22, 2014 at 11:47:01AM -0600, Karl Williamson wrote:
I added it to the "5.21.1 blockers ticket" Nicholas Clark |
From @nthykierOn 2014-03-22 18:46, karl williamson via RT wrote:
Thanks, looking forward to it. :) ~Niels |
@tonycoz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#121489 (status was 'resolved')
Searchable as RT121489$
The text was updated successfully, but these errors were encountered: