Michel Bestaat
I guess the real bug is that the code to get the next accesses the original items array whereas the map function runs on a filtered array from which items may be removed. Just don't have deleted items and all will be fine...
1 3
Samuel
@samuel.fm
correct! solution is to use the 3rd arg of map, which will be the filtered array
2 5
Michel Bestaat
Not sure if there would be performance and/or additional memory costs though. I probably cannot count on the compiler to optimize the code. :-)
1 1
Samuel
No it’s perform exactly the same, the runtime would totally be able to deal with that
1