From 969a9c2fc8b2f68ed62e6516f4cb207fc872b0ab Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 15 Aug 2019 06:39:17 -0400 Subject: [PATCH] re-use the database-key instead of recreating it --- src/derived/slot.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/derived/slot.rs b/src/derived/slot.rs index 14b2b12b..96eaa3dc 100644 --- a/src/derived/slot.rs +++ b/src/derived/slot.rs @@ -171,7 +171,8 @@ where } }; - let mut panic_guard = PanicGuard::new(self.database_key(db), self, old_memo, runtime); + let database_key = self.database_key(db); + let mut panic_guard = PanicGuard::new(&database_key, self, old_memo, runtime); // If we have an old-value, it *may* now be stale, since there // has been a new revision since the last time we checked. So, @@ -184,7 +185,7 @@ where db.salsa_event(|| Event { runtime_id: runtime.id(), kind: EventKind::DidValidateMemoizedValue { - database_key: self.database_key(db), + database_key: database_key.clone(), }, }); @@ -196,7 +197,6 @@ where // Query was not previously executed, or value is potentially // stale, or value is absent. Let's execute! - let database_key = self.database_key(db); let mut result = runtime.execute_query_implementation(db, &database_key, || { info!("{:?}: executing query", self); @@ -526,7 +526,7 @@ where Q: QueryFunction, MP: MemoizationPolicy, { - database_key: DB::DatabaseKey, + database_key: &'me DB::DatabaseKey, slot: &'me Slot, memo: Option>, runtime: &'me Runtime, @@ -539,7 +539,7 @@ where MP: MemoizationPolicy, { fn new( - database_key: DB::DatabaseKey, + database_key: &'me DB::DatabaseKey, slot: &'me Slot, memo: Option>, runtime: &'me Runtime,