use every instead of filter - more explicit and enables early-exit from the loop

pull/9448/head
Rich Harris 3 years ago
parent 1dab4a7674
commit be6fd71a8c

@ -965,8 +965,7 @@ export function set_signal_value(signal, value) {
// TODO: should we put this being a is_runes check and only run it in non-runes mode? // TODO: should we put this being a is_runes check and only run it in non-runes mode?
if ( if (
current_effect === null && current_effect === null &&
current_queued_pre_and_render_effects.filter((e) => e.context === component_context) current_queued_pre_and_render_effects.every((e) => e.context !== component_context)
.length === 0
) { ) {
const update_callbacks = component_context?.update_callbacks; const update_callbacks = component_context?.update_callbacks;
if (update_callbacks != null) { if (update_callbacks != null) {

Loading…
Cancel
Save