diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-08 15:38:16 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-08 19:54:18 +0000 |
commit | 91472ad44ad2236cbe82f9d004014700b37a6bcc (patch) | |
tree | ae659878b189d4a7194750a86c8cb6b0999b1484 | |
parent | e2712234fb9f66b89b77d929912e337172313635 (diff) | |
download | perl-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.
-rw-r--r-- | pp_sys.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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)) |