Skip to content
Snippets Groups Projects
Commit c0102aaf authored by Fedor Sakharov's avatar Fedor Sakharov Committed by GitHub
Browse files

Avoid cloning and multiple entry calls (#2226)

parent 9dee08af
No related merge requests found
......@@ -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,
......
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