chore: don't capture writes that match the real value but not the batch's view

Neither the else-if branch in internal_set nor its equivalent in update_derived is needed for any test.
async-another-try-pt-1-prune
Rich Harris 16 hours ago
parent b60c1b23de
commit 579224846e
No known key found for this signature in database

@ -434,8 +434,6 @@ export function update_derived(derived) {
(previous_batch ?? current_batch)?.remove_dirty_reaction(derived); (previous_batch ?? current_batch)?.remove_dirty_reaction(derived);
return; return;
} }
} else if (batch_values?.has(derived) && !derived.equals(batch_values?.get(derived))) {
current_batch?.capture(derived, derived.v);
} }
// don't mark derived clean if we're reading it inside a // don't mark derived clean if we're reading it inside a

@ -37,7 +37,6 @@ import {
eager_block_effects, eager_block_effects,
schedule_effect, schedule_effect,
legacy_updates, legacy_updates,
current_batch,
first_batch first_batch
} from './batch.js'; } from './batch.js';
import { proxy } from '../proxy.js'; import { proxy } from '../proxy.js';
@ -276,8 +275,6 @@ export function internal_set(source, value, updated_during_traversal = null) {
if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) { if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {
flush_eager_effects(); flush_eager_effects();
} }
} else if (batch_values?.has(source) && !source.equals(batch_values?.get(source))) {
current_batch?.capture(source, source.v);
} }
return value; return value;

Loading…
Cancel
Save