There is code in pp_entersub() that specifically handles the case where
AvARRAY(@_) != AvALLOC(@_), and tries to be more efficient than just
realloc()ing AvALLOC().
However, @_'s that have been shifted or messed with are usually cleaned up
or abandoned by CLEAR_ARGARRAY/POPSUB anyway, so this code is (probably)
never called. So remove it.
In a worst case, it would just mean that realloc() is called
unnecessarily, which would be slower, but still correct.
cx->blk_sub.argarray = av;
++MARK;
- if (items > AvMAX(av) + 1) {
- SV **ary = AvALLOC(av);
- if (AvARRAY(av) != ary) {
- AvMAX(av) += AvARRAY(av) - AvALLOC(av);
- AvARRAY(av) = ary;
- }
- if (items > AvMAX(av) + 1) {
- AvMAX(av) = items - 1;
- Renew(ary,items,SV*);
- AvALLOC(av) = ary;
- AvARRAY(av) = ary;
- }
- }
+ if (items - 1 > AvMAX(av)) {
+ SV **ary = AvALLOC(av);
+ AvMAX(av) = items - 1;
+ Renew(ary, items, SV*);
+ AvALLOC(av) = ary;
+ AvARRAY(av) = ary;
+ }
+
Copy(MARK,AvARRAY(av),items,SV*);
AvFILLp(av) = items - 1;