mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-08-09 13:28:19 +00:00
return lifetime-extended memo, not value
Change the core operation to be `refresh_memo`. This is a nice refactoring on its own but it will also support the refactoring of how we manage accumulator values.
This commit is contained in:
parent
dcb0eb242e
commit
2caa5ccf87
4 changed files with 25 additions and 44 deletions
|
@ -1,8 +1,7 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use crate::{
|
||||
runtime::StampedValue, zalsa::ZalsaDatabase, zalsa_local::ActiveQueryGuard, Cycle, Database,
|
||||
Event, EventKind,
|
||||
zalsa::ZalsaDatabase, zalsa_local::ActiveQueryGuard, Cycle, Database, Event, EventKind,
|
||||
};
|
||||
|
||||
use super::{memo::Memo, Configuration, IngredientImpl};
|
||||
|
@ -25,7 +24,7 @@ where
|
|||
db: &'db C::DbView,
|
||||
active_query: ActiveQueryGuard<'_>,
|
||||
opt_old_memo: Option<Arc<Memo<C::Output<'_>>>>,
|
||||
) -> StampedValue<&C::Output<'db>> {
|
||||
) -> &'db Memo<C::Output<'db>> {
|
||||
let zalsa = db.zalsa();
|
||||
let revision_now = zalsa.current_revision();
|
||||
let database_key_index = active_query.database_key_index;
|
||||
|
@ -86,11 +85,6 @@ where
|
|||
|
||||
tracing::debug!("{database_key_index:?}: read_upgrade: result.revisions = {revisions:#?}");
|
||||
|
||||
let stamp_template = revisions.stamp_template();
|
||||
let value = self
|
||||
.insert_memo(zalsa, id, Memo::new(Some(value), revision_now, revisions))
|
||||
.unwrap();
|
||||
|
||||
stamp_template.stamp(value)
|
||||
self.insert_memo(zalsa, id, Memo::new(Some(value), revision_now, revisions))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue