pad.c: Use PadnamelistMAXNAMED in another place
This will speed up pad lookup a little more. This could be considered
a follow-up to commit
7db6405c.
There is a hack that allows an ‘our’ variable to be found in the pad
in the statement in which it is declared, to avoid a warning (since
the fallback would be to look up the very same variable in the current
package anyway).
This commit applies the PadnamelistMAXNAMED optimisation to that code
path. This is how that optimisation works: When named slots are
allocated in the pad, PadnamelistMAXNAMED is set, so that, when
searching for named items in the pad, we don’t have to search the
whole thing if there are many constants or GVs at the end.
Recent commits slowed down t/re/uniprops.t considerably. This was the remaining bottleneck.
We could actually skip the whole ‘our’ hack for subroutine lookup
(since the warning it avoids doesn’t apply to subroutines anyway). In
fact, the next commit will do that. But this optimisation is worth-
while anyway.