Skip to content

Commit

Permalink
tune
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Jul 2, 2024
1 parent 3aeb42a commit 1610602
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ function remove_reaction(signal, dependency) {
export function remove_reactions(signal, start_index) {
const dependencies = signal.deps;
if (dependencies !== null) {
var active_dependencies = start_index === 0 ? null : dependencies.slice(0, start_index);
var visited = new Set();
let i;
for (i = start_index; i < dependencies.length; i++) {
Expand All @@ -428,10 +427,7 @@ export function remove_reactions(signal, start_index) {
continue;
}
visited.add(dependency);
// Avoid removing a reaction if we know that it is active (start_index will not be 0)
if (active_dependencies === null || !active_dependencies.includes(dependency)) {
remove_reaction(signal, dependency);
}
remove_reaction(signal, dependency);
}
}
}
Expand Down

0 comments on commit 1610602

Please sign in to comment.