From 5472cfdbc870ba55a3f35277649a0886528bb3bd Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 1 Oct 2018 13:20:18 -0400 Subject: [PATCH] simplify the logic by using `changed_at` and not `verified_at` I think they are actually equivalent, as we have already fond that the inputs did not change in the range `changed_at..=verified_at`. --- src/memoized.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/memoized.rs b/src/memoized.rs index 0674fe31..7dbbba79 100644 --- a/src/memoized.rs +++ b/src/memoized.rs @@ -128,11 +128,9 @@ where // first things first, let's walk over each of our previous // inputs and check whether they are out of date. if let Some(QueryState::Memoized(old_memo)) = &mut old_value { - if old_memo - .inputs - .iter() - .all(|old_input| !old_input.maybe_changed_since(query, old_memo.verified_at)) - { + if old_memo.inputs.iter().all(|old_input| { + !old_input.maybe_changed_since(query, old_memo.stamped_value.changed_at) + }) { debug!("{:?}({:?}): inputs still valid", Q::default(), key); // If none of out inputs have changed since the last time we refreshed