Skip to content

Commit b6c8c2b

Browse files
authored
perf: avoid unnecessary clones in query_ciphertexts (#1875)
perf(worker): optimize memory usage in query_ciphertexts
1 parent a9dc955 commit b6c8c2b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

coprocessor/fhevm-engine/tfhe-worker/src/tfhe_worker.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,8 @@ async fn query_ciphertexts<'a>(
263263
// index ciphertexts in hashmap
264264
let mut ciphertext_map: HashMap<Vec<u8>, (i16, Vec<u8>)> =
265265
HashMap::with_capacity(ciphertexts_rows.len());
266-
for row in &ciphertexts_rows {
267-
let _ = ciphertext_map.insert(
268-
row.handle.clone(),
269-
(row.ciphertext_type, row.ciphertext.clone()),
270-
);
266+
for row in ciphertexts_rows {
267+
let _ = ciphertext_map.insert(row.handle, (row.ciphertext_type, row.ciphertext));
271268
}
272269
Ok(ciphertext_map)
273270
}

0 commit comments

Comments
 (0)