1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-10 00:25:40 +00:00

🔨 Call Array.Empty<T>() in Stream.GetHash<T>()

This commit is contained in:
Oliver Booth 2019-11-16 11:09:04 +00:00
parent a14de1fa96
commit 3b0c304f54
No known key found for this signature in database
GPG Key ID: 4B0992B2602C3778

View File

@ -22,7 +22,7 @@
/// <returns>Returns a <see cref="Byte"/> array representing the hash of the stream.</returns>
public static byte[] GetHash<T>(this Stream stream) where T : HashAlgorithm
{
MethodInfo create = typeof(T).GetMethod("Create", new Type[] { });
MethodInfo create = typeof(T).GetMethod("Create", Array.Empty<Type>());
using T crypt = (T)create?.Invoke(null, null);
return crypt?.ComputeHash(stream);
}