ow! You transformed a O(N) problem into an O(N2) solution.
firstidx starts at the start of the array every loop pass.
Not only did you half the speed, you doubled the memory requirements.
"firstidx" copies the entire array before processing it.
In reply to Re^3: Testing if an array contains a value and then deleting it in most efficient way
by ikegami
in thread Testing if an array contains a value and then deleting it in most efficient way
by karpatov
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |