Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
op.c: Apply spair optimisation to \% \@ \&
The ‘spair’ (scalar/single pair) optimisation applies to a few operat- ors for which there are actually pairs of ops, one for scalars or sin- gle items, the other for lists. refgen is one of them. When taking references, hashes, arrays and subroutines are single items, just like scalars, so they can go through the ‘single’ code and benefit, too. refassign will also benefit from this, as \@A = [] (not yet imple- mented) should provide scalar context to the right-hand side, and this avoids the need for special cases (because srefgen with the initial s provides scalar context). (This optimisation could have applied to aggregates passed to cho(m)p, but it results in incorrect messages like ‘Uninitialized value in sca- lar chomp’ for chomp @_, so I’ve left it for now.)
- Loading branch information