flowjs / flow.js

A JavaScript library providing multiple simultaneous, stable, fault-tolerant and resumable/restartable file uploads via the HTML5 File API.
Other
2.96k stars 346 forks source link

Stop remove file from looping after the correct file is found #357

Closed ilessiivi closed 2 years ago

ilessiivi commented 2 years ago

Stopping the loop might have a minor performance benefit.

drzraf commented 2 years ago

While I agree in theory, I notice that addFiles does not do deduplication: The same file could be queued twice. In that context, don't you think that removing all duplicate occurrences could also be an adequate behavior?

ilessiivi commented 2 years ago

Added the necessary check for the option that allows duplicates and squashed the commits.