chore: improve signal runtime perf (#12093)

* chore: improve signal runtime perf

* chore: improve signal runtime perf

* chore: improve signal runtime perf
pull/12096/head
Dominic Gannaway 3 months ago committed by GitHub
parent c7f6805c37
commit 04eaf17519
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
chore: improve runtime performance of capturing reactive signals

@ -357,11 +357,7 @@ export function execute_reaction_fn(signal) {
if (reactions === null) {
dependency.reactions = [signal];
} else if (reactions[reactions.length - 1] !== signal) {
// TODO: should this be:
//
// } else if (!reactions.includes(signal)) {
//
} else if (reactions[reactions.length - 1] !== signal && !reactions.includes(signal)) {
reactions.push(signal);
}
}

Loading…
Cancel
Save