stevenbenner / interfacelift-downloader

:floppy_disk: InterfaceLIFT wallpaper auto-downloader script for Node.js.
MIT License
92 stars 16 forks source link

Refactor Downloader() to fix or remove recursion. #9

Closed stevenbenner closed 2 years ago

stevenbenner commented 10 years ago

Right now the Downloader() object uses recursion to iterate through the list. This is problematic because it will lead to a very large call stack unless you use a setImmediate() to break out of it (see: commit 747ce133f08bae4c637a74e8735946d5eb6af65c).

I do not like the setImmediate() approach because it feels like a code smell. So this object needs to be refactored to either replace the recursion with some flavor of simple iteration or the recursion needs to be implemented in such a way that it wont negatively impact the call stack or memory usage.

medienoekonom commented 8 years ago

it works. so i dont give a fu§! :)

stevenbenner commented 2 years ago

I'm inclined to agree.

It has been 8 years and I haven't felt the need to make this optimization yet, so I'm just going to close this issue.