Unverified Commit 05b91fb4 authored by Fedor Sakharov's avatar Fedor Sakharov Committed by GitHub
Browse files

Avoid cloning and multiple entry calls (#2226)

parent 5ea2527e
Pipeline #119248 passed with stages
in 29 minutes and 19 seconds
......@@ -1000,9 +1000,7 @@ fn store_chunks(
);
}
for chunk in chunks {
subsystem.chunks_cache.entry(*candidate_hash).or_default().insert(chunk.index, chunk.clone());
for chunk in &chunks {
let pruning_record = ChunkPruningRecord {
candidate_hash: candidate_hash.clone(),
block_number,
......@@ -1024,6 +1022,8 @@ fn store_chunks(
);
}
subsystem.chunks_cache.entry(*candidate_hash).or_default().extend(chunks.into_iter().map(|c| (c.index, c)));
tx.put_vec(
columns::META,
&CHUNK_PRUNING_KEY,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment