BackburnerJS / backburner.js

A rewrite of the Ember.js run loop as a generic microlibrary
MIT License
392 stars 80 forks source link

remove unnecessary `queueItems.length` check #292

Closed bekzod closed 6 years ago

bekzod commented 6 years ago

quueuItems.length already checked before calling flush here: https://github.com/BackburnerJS/backburner.js/blob/master/lib/backburner/deferred-action-queues.ts#L64 and here: https://github.com/BackburnerJS/backburner.js/blob/master/lib/backburner/queue.ts#L98

rwjblue commented 6 years ago

Flush is public API, I don’t think we are guaranteed that end users only call it after a length check...

stefanpenner commented 6 years ago

I agree with @rwjblue, we would need to make a private method that is shared to avoid the length check. (which is a fine change, but closing this for now)