removed unneeded extra alloc

This commit is contained in:
2025-08-17 13:24:44 -04:00
parent 41841cdcd6
commit 5a6311f20f
4 changed files with 12 additions and 16 deletions

View File

@@ -19,11 +19,10 @@ impl Hasher for MD5 {
self.hasher.update(bytes.as_ref())
}
fn complete(self) -> HashReturn {
fn complete(mut self) -> HashReturn {
let res = self.hasher.finalize();
let mut ret = BITS128::default();
ret.copy_from_slice(&res);
HashReturn::MD5(ret)
self.hash.copy_from_slice(&res);
HashReturn::MD5(self.hash)
}
}