Skip to content

Commit 88a84ff

Browse files
committed
chore: use set for version reactions
1 parent 290dfa5 commit 88a84ff

File tree

1 file changed

+6
-1
lines changed
  • packages/svelte/src/reactivity

1 file changed

+6
-1
lines changed

packages/svelte/src/reactivity/map.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ export class SvelteMap extends Map {
105105
increment(s);
106106

107107
// if not every reaction of s is a reaction of version we need to also include version
108-
const needs_version_increase = !s.reactions?.every((r) => version.reactions?.includes(r));
108+
var v_reactions = version.reactions === null ? null : new Set(version.reactions);
109+
var needs_version_increase =
110+
v_reactions === null ||
111+
!s.reactions?.every((r) =>
112+
/** @type {NonNullable<typeof v_reactions>} */ (v_reactions).has(r)
113+
);
109114
if (needs_version_increase) {
110115
increment(version);
111116
}

0 commit comments

Comments
 (0)