General code style and feature fixes.

This commit is contained in:
2022-11-15 01:35:06 +00:00
parent f44172edb9
commit 8b24f6ed00
2 changed files with 4 additions and 9 deletions

View File

@@ -46,8 +46,7 @@ public static partial class ArrayHelpers
/// <typeparam name="T">Array type</typeparam>
public static void ArrayFill<T>(T[] destinationArray, T[] value)
{
if(destinationArray == null)
throw new ArgumentNullException(nameof(destinationArray));
ArgumentNullException.ThrowIfNull(destinationArray);
if(value.Length > destinationArray.Length)
throw new ArgumentException("Length of value array must not be more than length of destination");

View File

@@ -345,13 +345,9 @@ public static class DateHandlers
/// <summary>Converts a LIF timestamp to .NET DateTime</summary>
/// <param name="date">LIF timestamp</param>
/// <returns>.NET DateTime</returns>
public static DateTime LifToDateTime(byte[] date)
{
if(date is not { Length: 6 })
return new DateTime(1970, 1, 1, 0, 0, 0);
return LifToDateTime(date[0], date[1], date[2], date[3], date[4], date[5]);
}
public static DateTime LifToDateTime(byte[] date) => date is not { Length: 6 } ? new DateTime(1970, 1, 1, 0, 0, 0)
: LifToDateTime(date[0], date[1], date[2], date[3],
date[4], date[5]);
/// <summary>Converts a LIF timestamp to .NET DateTime</summary>
/// <param name="year">Yer</param>