- HV *keys = avhv_keys(av);
- SV *sv;
- I32 ind;
-
- sv = hv_iterval(keys, entry);
- ind = SvIV(sv);
- if (ind < 1)
- croak("Bad index while coercing array into hash");
- return *av_fetch(av, ind, TRUE);
-}
-
-SV *
-avhv_iternextsv(AV *av, char **key, I32 *retlen)
-{
- HV *keys = avhv_keys(av);
- HE *he;
- SV *sv;
- I32 ind;
-
- he = hv_iternext(keys);
- if (!he)
- return Nullsv;
- *key = hv_iterkey(he, retlen);
- sv = hv_iterval(keys, he);
- ind = SvIV(sv);
- if (ind < 1)
- croak("Bad index while coercing array into hash");
- return *av_fetch(av, ind, TRUE);
+ SV *sv = hv_iterval(avhv_keys(av), entry);
+ return *av_fetch(av, avhv_index_sv(sv), TRUE);