Make the code slightly simpler by doing an early RETPUSHYES after success
where possible.
}
}
- if (gimme == G_ARRAY) {
+ if ((!RX_NPARENS(rx) && !global) || gimme != G_ARRAY) {
+ LEAVE_SCOPE(oldsave);
+ RETPUSHYES;
+ }
+
+ {
const I32 nparens = RX_NPARENS(rx);
I32 i = (global && !nparens) ? 1 : 0;
r_flags |= REXEC_IGNOREPOS | REXEC_NOT_FIRST;
goto play_it_again;
}
- else if (!nparens)
- XPUSHs(&PL_sv_yes);
LEAVE_SCOPE(oldsave);
RETURN;
}
- else {
- LEAVE_SCOPE(oldsave);
- RETPUSHYES;
- }
yup: /* Confirmed by INTUIT */
assert(!RX_NPARENS(rx));