chore: small tidy up (#16476)

pull/16478/head
Rich Harris 2 months ago committed by GitHub
parent 1deb31082a
commit 68372460e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -193,6 +193,8 @@ export class Batch {
// if we didn't start any new async work, and no async work
// is outstanding from a previous flush, commit
if (this.#async_effects.length === 0 && this.#pending === 0) {
this.#commit();
var render_effects = this.#render_effects;
var effects = this.#effects;
@ -200,8 +202,6 @@ export class Batch {
this.#effects = [];
this.#block_effects = [];
this.#commit();
flush_queued_effects(render_effects);
flush_queued_effects(effects);
@ -539,11 +539,12 @@ function flush_queued_effects(effects) {
var length = effects.length;
if (length === 0) return;
for (var i = 0; i < length; i++) {
var effect = effects[i];
var i = 0;
while (i < length) {
var effect = effects[i++];
if ((effect.f & (DESTROYED | INERT)) === 0) {
if (is_dirty(effect)) {
if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {
var wv = write_version;
update_effect(effect);
@ -572,10 +573,9 @@ function flush_queued_effects(effects) {
}
}
}
}
for (; i < length; i += 1) {
schedule_effect(effects[i]);
while (i < length) {
schedule_effect(effects[i++]);
}
}

Loading…
Cancel
Save