Next | Making Programs Faster | 14 |
sort { lc $a cmp lc $b } @stuff;
@sorted = map {$_->[0]} sort {$a->[1] cmp $b->[1]} map {[$_, lc $_]} @stuff;
The 'benefit' here was to reduce the number of lc operations
The cost was to introduce array reference lookup operations in their place
And two extra scans over the list
And some memory allocation
But he got his pony!
More ponies later
Next | Copyright © 2003 M. J. Dominus |