you could at least move the array more to the middle ground (on average)
Pretending for a second that first doesn't require putting the contents of entire array on the stack, the performance would still be O(N).
Mind you, that's rarely a problem since most arrays are quite small, but the code is also much less readable.
In reply to Re^6: Convert a string into a hash
by ikegami
in thread Convert a string into a hash
by vitoco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |