Skip to content

Commit

Permalink
fixed missing hash calculation in logical container
Browse files Browse the repository at this point in the history
  • Loading branch information
ph0llux committed Jul 29, 2024
1 parent fd5598d commit 1e9d43b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ impl HashingThreadManager {
/// finalizes all hashing threads and returns a HashMap<HashType, Vec<u8>> with the appropriate hash values.
pub fn finalize_all(&mut self) -> HashMap<HashType, Vec<u8>> {
let mut result = HashMap::new();
for (hash_type, thread) in self.threads.drain() {
result.insert(hash_type, thread.finalize());
for (hash_type, thread) in &self.threads {
result.insert(hash_type.clone(), thread.finalize());
}
result
}
Expand Down Expand Up @@ -215,7 +215,7 @@ impl HashingThread {

/// returns the hash of the given data.
/// This function blocks until the hash is calculated.
pub fn finalize(self) -> Vec<u8> {
pub fn finalize(&self) -> Vec<u8> {
let wg = crossbeam::sync::WaitGroup::new();
self.trigger.send((wg.clone(), true)).unwrap();
wg.wait();
Expand Down

0 comments on commit 1e9d43b

Please sign in to comment.