Avoid unncessary allocation in hashing

This commit is contained in:
Matt Nadareski
2023-10-26 11:42:36 -04:00
parent e924299f85
commit 101cdb7b34
2 changed files with 2 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
- Move Hash enum and simplify
- Add other non-cryptographic hashes
- Avoid unncessary allocation in hashing
### 2.7.3 (2023-10-26)

View File

@@ -95,6 +95,7 @@ namespace MPF.Core.Hashing
/// <summary>
/// Finalize the internal hash algorigthm
/// </summary>
/// <remarks>NonCryptographicHashAlgorithm implementations do not need finalization</remarks>
public void Terminate()
{
byte[] emptyBuffer = Array.Empty<byte>();
@@ -103,9 +104,6 @@ namespace MPF.Core.Hashing
case HashAlgorithm ha:
ha.TransformFinalBlock(emptyBuffer, 0, 0);
break;
case NonCryptographicHashAlgorithm ncha:
// No finalization is needed
break;
}
}