get_results(next_url, accumulated_results ++ results_from_page) would be too expensive for large datasets. [results_from_page | accumulated_results] will not iterate over all the results at each step.
Yes, this should be an efficiency improvement, although, if the ordering of the results matters, they may need some extra handling.
In case this were needed, I'd either order all the results at the end if there's a key for it, or reverse the results_from_page each time they are fetched, so that we have an 'end to beginning' ordered list).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
get_results(next_url, accumulated_results ++ results_from_page) would be too expensive for large datasets. [results_from_page | accumulated_results] will not iterate over all the results at each step.
Thanks for the suggestion, Alexey!
Yes, this should be an efficiency improvement, although, if the ordering of the results matters, they may need some extra handling.
In case this were needed, I'd either order all the results at the end if there's a key for it, or reverse the results_from_page each time they are fetched, so that we have an 'end to beginning' ordered list).