fast-path no-op gc as well

This commit is contained in:
Aleksey Kladov 2019-01-29 19:41:15 +03:00
parent f9cae4f2eb
commit e3c07b010a

View file

@ -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