In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/490b24f64ea32c981bbd0eb40a4e029676710954?hp=4d25b7b08aaf2671c67fde2ac79b29a97966579a>

- Log -----------------------------------------------------------------
commit 490b24f64ea32c981bbd0eb40a4e029676710954
Author: David Mitchell <da...@iabyn.com>
Date:   Tue Mar 6 15:08:23 2018 +0000

    pp_repeat: avoid calling GIMME_V twice
    
    assign its value to a local var instead. GIMME_V can have a considerable
    overhead when called in unknown context.
    
    I audited the rest of the pp*.c files, but didn't find any similar
    multiple calls.

-----------------------------------------------------------------------

Summary of changes:
 pp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pp.c b/pp.c
index 4c0a5b34b7..9a9ad3e1f8 100644
--- a/pp.c
+++ b/pp.c
@@ -1671,8 +1671,9 @@ PP(pp_repeat)
     IV count;
     SV *sv;
     bool infnan = FALSE;
+    const U8 gimme = GIMME_V;
 
-    if (GIMME_V == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
+    if (gimme == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
        /* TODO: think of some way of doing list-repeat overloading ??? */
        sv = POPs;
        SvGETMAGIC(sv);
@@ -1736,7 +1737,7 @@ PP(pp_repeat)
                        "Negative repeat count does nothing");
     }
 
-    if (GIMME_V == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
+    if (gimme == G_ARRAY && PL_op->op_private & OPpREPEAT_DOLIST) {
        dMARK;
        const SSize_t items = SP - MARK;
        const U8 mod = PL_op->op_flags & OPf_MOD;

-- 
Perl5 Master Repository

Reply via email to