mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-08-04 11:00:05 +00:00
fix: Use changed_at
revision when updating fields (#778)
Setting the field's revision to `current_revision` when updating is not technically wrong, but its pessimizing. If all previous reads only observed a change of up to `changed_at`, then it's fine for us to do the same as nothing we derive from has read from `current_revision`.
This commit is contained in:
parent
5ee3bdde58
commit
20a347e147
1 changed files with 2 additions and 2 deletions
|
@ -553,7 +553,7 @@ where
|
|||
// to meet its safety invariant.
|
||||
unsafe {
|
||||
if C::update_fields(
|
||||
current_revision,
|
||||
current_deps.changed_at,
|
||||
&mut data.revisions,
|
||||
self.to_self_ptr(std::ptr::addr_of_mut!(data.fields)),
|
||||
fields,
|
||||
|
@ -568,7 +568,7 @@ where
|
|||
}
|
||||
}
|
||||
if current_deps.durability < data.durability {
|
||||
data.revisions = C::new_revisions(current_revision);
|
||||
data.revisions = C::new_revisions(current_deps.changed_at);
|
||||
data.created_at = current_revision;
|
||||
}
|
||||
data.durability = current_deps.durability;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue