hash argument is not used anymore in do_oddball
authorRuslan Zakirov <ruz@bestpractical.com>
Sat, 20 Oct 2012 10:40:13 +0000 (14:40 +0400)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 11 Dec 2012 16:59:42 +0000 (08:59 -0800)
rename arguments to make more clear what function takes

embed.fnc
embed.h
pp_hot.c
proto.h

index 6d6befe..0a382f6 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1904,7 +1904,7 @@ s |OP*    |do_smartmatch  |NULLOK HV* seen_this \
 #endif
 
 #if defined(PERL_IN_PP_HOT_C)
-s      |void   |do_oddball     |NN HV *hash|NN SV **relem|NN SV **firstrelem
+s      |void   |do_oddball     |NN SV **oddkey|NN SV **firstkey
 sR     |SV*    |method_common  |NN SV* meth|NULLOK U32* hashp
 #endif
 
diff --git a/embed.h b/embed.h
index fbb49f6..d6b1c2f 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define save_lines(a,b)                S_save_lines(aTHX_ a,b)
 #  endif
 #  if defined(PERL_IN_PP_HOT_C)
-#define do_oddball(a,b,c)      S_do_oddball(aTHX_ a,b,c)
+#define do_oddball(a,b)                S_do_oddball(aTHX_ a,b)
 #define method_common(a,b)     S_method_common(aTHX_ a,b)
 #  endif
 #  if defined(PERL_IN_PP_PACK_C)
index 16fcd23..2c6638b 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -950,19 +950,19 @@ PP(pp_rv2av)
 }
 
 STATIC void
-S_do_oddball(pTHX_ HV *hash, SV **relem, SV **firstrelem)
+S_do_oddball(pTHX_ SV **oddkey, SV **firstkey)
 {
     dVAR;
 
     PERL_ARGS_ASSERT_DO_ODDBALL;
 
-    if (*relem) {
+    if (*oddkey) {
         if (ckWARN(WARN_MISC)) {
            const char *err;
-           if (relem == firstrelem &&
-               SvROK(*relem) &&
-               (SvTYPE(SvRV(*relem)) == SVt_PVAV ||
-                SvTYPE(SvRV(*relem)) == SVt_PVHV))
+           if (oddkey == firstkey &&
+               SvROK(*oddkey) &&
+               (SvTYPE(SvRV(*oddkey)) == SVt_PVAV ||
+                SvTYPE(SvRV(*oddkey)) == SVt_PVHV))
            {
                err = "Reference found where even-sized list expected";
            }
@@ -1085,7 +1085,7 @@ PP(pp_aassign)
 
                 odd = ((lastrelem - firsthashrelem)&1)? 0 : 1;
                 if ( odd ) {
-                    do_oddball(hash, lastrelem, firsthashrelem);
+                    do_oddball(lastrelem, firsthashrelem);
                     /* we have lelem to reuse, it's not needed anymore */
                     *(lastrelem+1) = &PL_sv_undef;
                 }
diff --git a/proto.h b/proto.h
index 2875e76..7f4942e 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -6158,12 +6158,11 @@ STATIC void     S_save_lines(pTHX_ AV *array, SV *sv)
 
 #endif
 #if defined(PERL_IN_PP_HOT_C)
-STATIC void    S_do_oddball(pTHX_ HV *hash, SV **relem, SV **firstrelem)
+STATIC void    S_do_oddball(pTHX_ SV **oddkey, SV **firstkey)
                        __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2)
-                       __attribute__nonnull__(pTHX_3);
+                       __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_DO_ODDBALL    \
-       assert(hash); assert(relem); assert(firstrelem)
+       assert(oddkey); assert(firstkey)
 
 STATIC SV*     S_method_common(pTHX_ SV* meth, U32* hashp)
                        __attribute__warn_unused_result__