summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2014-03-01 15:49:28 +0100
committerYves Orton <demerphq@gmail.com>2014-03-18 08:37:04 +0100
commitbea177f3c4412e3250a860c64abed7595ae6373a (patch)
tree728d1b40b2a0bea0f04a2c2ca7e91cbdb0133242 /hv.c
parent12733a0391a05c17c34b642aa1694e0d482f3df6 (diff)
downloadperl-bea177f3c4412e3250a860c64abed7595ae6373a.tar.gz
Split out part of hv_auxinit() so it can be reused
Changes nothing except that it introduces hv_auxinit_interal() which does part of the job of hv_auxinit(), so that we can call it from somewhere else in the next commit.
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/hv.c b/hv.c
index 9d80659853..28e5ecf897 100644
--- a/hv.c
+++ b/hv.c
@@ -1938,6 +1938,23 @@ PERL_STATIC_INLINE U32 S_ptr_hash(PTRV u) {
return (U32)u;
}
+static struct xpvhv_aux*
+S_hv_auxinit_internal(struct xpvhv_aux *iter) {
+ PERL_ARGS_ASSERT_HV_AUXINIT_INTERNAL;
+ iter->xhv_riter = -1; /* HvRITER(hv) = -1 */
+ iter->xhv_eiter = NULL; /* HvEITER(hv) = NULL */
+#ifdef PERL_HASH_RANDOMIZE_KEYS
+ iter->xhv_last_rand = iter->xhv_rand;
+#endif
+ iter->xhv_fill_lazy = 0;
+ iter->xhv_name_u.xhvnameu_name = 0;
+ iter->xhv_name_count = 0;
+ iter->xhv_backreferences = 0;
+ iter->xhv_mro_meta = NULL;
+ iter->xhv_aux_flags = 0;
+ return iter;
+}
+
static struct xpvhv_aux*
S_hv_auxinit(pTHX_ HV *hv) {
@@ -1971,18 +1988,7 @@ S_hv_auxinit(pTHX_ HV *hv) {
iter = HvAUX(hv);
}
- iter->xhv_riter = -1; /* HvRITER(hv) = -1 */
- iter->xhv_eiter = NULL; /* HvEITER(hv) = NULL */
-#ifdef PERL_HASH_RANDOMIZE_KEYS
- iter->xhv_last_rand = iter->xhv_rand;
-#endif
- iter->xhv_fill_lazy = 0;
- iter->xhv_name_u.xhvnameu_name = 0;
- iter->xhv_name_count = 0;
- iter->xhv_backreferences = 0;
- iter->xhv_mro_meta = NULL;
- iter->xhv_aux_flags = 0;
- return iter;
+ return hv_auxinit_internal(iter);
}
/*