I think in this case the array creation and population makes significant influence on results. Consider this
You missed the point. The shifting of elements from the array makes it empty after first iteration. But Benchmark makes thousands of iteration within 1 second. All of those iterations work with empty array, this explains why this approach appears to be "faster".
In reply to Re^4: Unpacking and converting
by andal
in thread Unpacking and converting
by dwalin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |