From aec7368c0a9c9b8ba6c36dfc9d740af3a1c9a4c4 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 4 Jun 2025 16:53:21 -0400 Subject: [PATCH] tidy up --- .../src/internal/client/reactivity/batch.js | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index 0c2e034bc5..65bd61472e 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -97,7 +97,7 @@ export class Batch { process_effects(this, root); } - if (this.async_effects.length === 0 && this.settled()) { + if (this.async_effects.length === 0 && this.#pending === 0) { var merged = false; // if there are older batches with overlapping @@ -191,25 +191,6 @@ export class Batch { remove() { batches.delete(this); - - // for (var batch of batches) { - // /** @type {Source} */ - // var source; - - // if (batch.#id < this.#id) { - // // other batch is older than this - // for (source of this.#previous.keys()) { - // batch.#previous.delete(source); - // } - // } else { - // // other batch is newer than this - // for (source of batch.#previous.keys()) { - // if (this.#previous.has(source)) { - // batch.#previous.set(source, source.v); - // } - // } - // } - // } } restore() { @@ -223,7 +204,7 @@ export class Batch { return; } - if (this.settled()) { + if (this.#pending === 0) { this.remove(); } @@ -231,7 +212,6 @@ export class Batch { } commit() { - // commit changes for (const fn of this.#callbacks) { fn(); } @@ -266,10 +246,6 @@ export class Batch { } } - settled() { - return this.#pending === 0; - } - /** @param {() => void} fn */ add_callback(fn) { this.#callbacks.add(fn);