if (!SvOK(cur))
continue;
if (!SvROK(cur)) {
- if (strEQ(SvPV_nolen(cur), "list")) {
- hv_clear(res);
- sn_store(res, "list", 4, newSVuv(1), sn_hash_list);
- break;
- } else {
- NV v = 1;
- if ((old = hv_fetch_ent(res, cur, 1, 0)) && SvOK(val = HeVAL(old)))
- v += SvNV(val);
- sn_store_ent(res, cur, newSVnv(v), 0);
- continue;
- }
+ NV v = 1;
+ if ((old = hv_fetch_ent(res, cur, 1, 0)) && SvOK(val = HeVAL(old)))
+ v += SvNV(val);
+ sn_store_ent(res, cur, newSVnv(v), 0);
+ continue;
}
cur = SvRV(cur);
hv_iterinit((HV *) cur);
*add = *Sub::Nary::add{CODE};
-is_deeply(add('list'), { list => 1 }, 'add list');
-is_deeply(add(1, 'list'), { list => 1 }, 'add const, list');
-is_deeply(add({ }, 'list'), { list => 1 }, 'add empty-ref, list');
-is_deeply(add({ 1 => 1 }, 'list'), { list => 1 }, 'add ref, list');
-is_deeply(add({ 1 => 1 }, 1), { 1 => 2 }, 'add ref, prev-const');
+is_deeply(add('list'), { list => 1 }, 'add list');
+is_deeply(add(1, 'list'), { 1 => 1, list => 1 }, 'add const, list');
+is_deeply(add({ }, 'list'), { list => 1 }, 'add empty-ref, list');
+is_deeply(add({ 1 => 1 }, 'list'), { 1 => 1, list => 1 }, 'add ref, list');
+is_deeply(add({ 1 => 1 }, 1), { 1 => 2 }, 'add ref, prev-const');
*cumulate = *Sub::Nary::cumulate{CODE};