Skip to content

Commit

Permalink
chore: use set for version reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Oct 26, 2024
1 parent 290dfa5 commit 88a84ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/svelte/src/reactivity/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ export class SvelteMap extends Map {
increment(s);

// if not every reaction of s is a reaction of version we need to also include version
const needs_version_increase = !s.reactions?.every((r) => version.reactions?.includes(r));
var v_reactions = version.reactions === null ? null : new Set(version.reactions);
var needs_version_increase =
v_reactions === null ||
!s.reactions?.every((r) =>
/** @type {NonNullable<typeof v_reactions>} */ (v_reactions).has(r)
);
if (needs_version_increase) {
increment(version);
}
Expand Down

0 comments on commit 88a84ff

Please sign in to comment.