1
0
Fork 0
mirror of synced 2024-05-17 19:03:08 +12:00

In prehashing check for user clicks, less often

This commit is contained in:
Rafał Mikrut 2023-05-03 09:37:06 +02:00
parent 72df211ca2
commit be04466ecc

View file

@ -750,11 +750,11 @@ impl DuplicateFinder {
let mut buffer = [0u8; 1024 * 2];
atomic_counter.fetch_add(vec_file_entry.len(), Ordering::Relaxed);
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
check_was_stopped.store(true, Ordering::Relaxed);
return None;
}
for file_entry in vec_file_entry {
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
check_was_stopped.store(true, Ordering::Relaxed);
return None;
}
match hash_calculation(&mut buffer, file_entry, &check_type, 0) {
Ok(hash_string) => {
hashmap_with_hash.entry(hash_string.clone()).or_insert_with(Vec::new).push(file_entry.clone());