Eliminated usage of default parameters.
This commit is contained in:
@@ -96,7 +96,7 @@ namespace OpenRA.FileFormats
|
||||
/// <returns>
|
||||
/// The calculated checksum.
|
||||
/// </returns>
|
||||
public static uint Calculate(byte[] data, uint polynomal = 0xFFFFFFFF)
|
||||
public static uint Calculate(byte[] data, uint polynomal)
|
||||
{
|
||||
uint crc = polynomal;
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
@@ -104,6 +104,10 @@ namespace OpenRA.FileFormats
|
||||
crc ^= polynomal;
|
||||
return crc;
|
||||
}
|
||||
public static uint Calculate(byte[] data)
|
||||
{
|
||||
return Calculate(data, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A fast (native) CRC32 implementation that can be used on a pinned byte array using
|
||||
@@ -113,7 +117,7 @@ namespace OpenRA.FileFormats
|
||||
/// <param name="len"> The length of the data data.</param>
|
||||
/// <param name="polynomal">The polynomal to xor with.</param>
|
||||
/// <returns>The calculated checksum.</returns>
|
||||
public static unsafe uint Calculate(byte* data, uint len, uint polynomal = 0xFFFFFFFF)
|
||||
public static unsafe uint Calculate(byte* data, uint len, uint polynomal)
|
||||
{
|
||||
uint crc = polynomal;
|
||||
for (int i = 0; i < len; i++)
|
||||
@@ -121,5 +125,9 @@ namespace OpenRA.FileFormats
|
||||
crc ^= polynomal;
|
||||
return crc;
|
||||
}
|
||||
public static unsafe uint Calculate(byte* data, uint len)
|
||||
{
|
||||
return Calculate(data, len, 0xFFFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user