This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Make some refcnt changes NN
authorKarl Williamson <khw@cpan.org>
Sun, 8 Dec 2019 19:25:04 +0000 (12:25 -0700)
committerKarl Williamson <khw@cpan.org>
Mon, 9 Dec 2019 22:32:49 +0000 (15:32 -0700)
to save a few cycles

regcomp.c

index 18e835c..6aa9c62 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -19652,16 +19652,17 @@ S_set_ANYOF_arg(pTHX_ RExC_state_t* const pRExC_state,
        SV *rv;
 
         if (cp_list) {
-            av_store(av, INVLIST_INDEX, SvREFCNT_inc(cp_list));
+            av_store(av, INVLIST_INDEX, SvREFCNT_inc_NN(cp_list));
         }
 
         if (only_utf8_locale_list) {
             av_store(av, ONLY_LOCALE_MATCHES_INDEX,
-                                          SvREFCNT_inc(only_utf8_locale_list));
+                                     SvREFCNT_inc_NN(only_utf8_locale_list));
         }
 
         if (runtime_defns) {
-            av_store(av, DEFERRED_USER_DEFINED_INDEX, SvREFCNT_inc(runtime_defns));
+            av_store(av, DEFERRED_USER_DEFINED_INDEX,
+                         SvREFCNT_inc_NN(runtime_defns));
         }
 
        rv = newRV_noinc(MUTABLE_SV(av));