Discussion draft: change DB Writer to take value references (#13672)

This commit is contained in:
James Prestwich
2025-01-07 12:38:09 -05:00
committed by GitHub
parent 2b301aa102
commit 3e980e61d8
41 changed files with 149 additions and 137 deletions

View File

@ -125,7 +125,7 @@ where
cursor.delete_current()?;
// Upsert will replace the last shard for this sharded key with
// the previous value.
cursor.upsert(RawKey::new(key), prev_value)?;
cursor.upsert(RawKey::new(key), &prev_value)?;
Ok(PruneShardOutcome::Updated)
}
// If there's no previous shard for this sharded key,
@ -151,7 +151,7 @@ where
} else {
cursor.upsert(
RawKey::new(key),
RawValue::new(BlockNumberList::new_pre_sorted(higher_blocks)),
&RawValue::new(BlockNumberList::new_pre_sorted(higher_blocks)),
)?;
Ok(PruneShardOutcome::Updated)
}