mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-28 15:26:34 +00:00
fast-path no-op gc as well
This commit is contained in:
parent
f9cae4f2eb
commit
e3c07b010a
1 changed files with 3 additions and 2 deletions
|
@ -948,6 +948,7 @@ where
|
||||||
map_write.clear();
|
map_write.clear();
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
(DiscardIf::Never, _) | (_, DiscardWhat::Nothing) => return,
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
map_write.retain(|key, query_state| {
|
map_write.retain(|key, query_state| {
|
||||||
|
@ -980,10 +981,10 @@ where
|
||||||
// when we read `revision_now`.
|
// when we read `revision_now`.
|
||||||
assert!(memo.verified_at <= revision_now);
|
assert!(memo.verified_at <= revision_now);
|
||||||
match strategy.discard_if {
|
match strategy.discard_if {
|
||||||
DiscardIf::Never => true,
|
DiscardIf::Never => unreachable!(),
|
||||||
DiscardIf::Outdated if memo.verified_at == revision_now => true,
|
DiscardIf::Outdated if memo.verified_at == revision_now => true,
|
||||||
DiscardIf::Outdated | DiscardIf::Always => match strategy.discard_what {
|
DiscardIf::Outdated | DiscardIf::Always => match strategy.discard_what {
|
||||||
DiscardWhat::Nothing => true,
|
DiscardWhat::Nothing => unreachable!(),
|
||||||
DiscardWhat::Values => {
|
DiscardWhat::Values => {
|
||||||
memo.value = None;
|
memo.value = None;
|
||||||
true
|
true
|
||||||
|
|
Loading…
Reference in a new issue