summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-01-08 15:38:16 +0000
committerNicholas Clark <nick@ccl4.org>2011-01-08 19:54:18 +0000
commit91472ad44ad2236cbe82f9d004014700b37a6bcc (patch)
treeae659878b189d4a7194750a86c8cb6b0999b1484 /pp_sys.c
parente2712234fb9f66b89b77d929912e337172313635 (diff)
downloadperl-91472ad44ad2236cbe82f9d004014700b37a6bcc.tar.gz
In pp_send, assign to io earlier, and use op_type instead of PL_op->op_type.
On this platform, this doesn't change the size of the object code, suggesting that there are all transformations that the optimiser had already spotted. However, the code is now clearer for humans.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/pp_sys.c b/pp_sys.c
index f8370f7c76..d8b31766d3 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1824,7 +1824,6 @@ PP(pp_sysread)
PP(pp_send)
{
dVAR; dSP; dMARK; dORIGMARK; dTARGET;
- IO *io;
SV *bufsv;
const char *buffer;
SSize_t retval;
@@ -1833,10 +1832,10 @@ PP(pp_send)
const int op_type = PL_op->op_type;
bool doing_utf8;
U8 *tmpbuf = NULL;
-
GV *const gv = MUTABLE_GV(*++MARK);
- if (PL_op->op_type == OP_SYSWRITE
- && gv && (io = GvIO(gv))) {
+ IO *const io = GvIO(gv);
+
+ if (op_type == OP_SYSWRITE && io) {
const MAGIC * const mg = SvTIED_mg((const SV *)io, PERL_MAGIC_tiedscalar);
if (mg) {
if (MARK == SP - 1) {
@@ -1856,7 +1855,6 @@ PP(pp_send)
bufsv = *++MARK;
SETERRNO(0,0);
- io = GvIO(gv);
if (!io || !IoIFP(io) || IoTYPE(io) == IoTYPE_RDONLY) {
retval = -1;
if (io && IoIFP(io))