in reply to Re: To splice or not to splice? What implementation is more readable, efficient, etc.?
in thread To splice or not to splice? What implementation is more readable, efficient, etc.?
Thank you everyone for criticism and comments, exactly kind of feedback (maybe not its contents) I wanted. Didn't expect junk I write (documentation, too) to be so incomprehensible. Except "key named 'value' causing confusion" (too much, no?), looks like I deserved it.
haukex, thank you for intention to suggest better algorithm or data structure -- I deliberately described it (failed to communicate though) as something abstract, it's really not worth anyone's effort.
P.S. As to benchmarking, you all are right again: loop with simple push to new array, of either element or its expansion, is faster than all of the above
|
|---|