mirror of
https://github.com/aaru-dps/Aaru.Helpers.git
synced 2025-12-16 19:24:35 +00:00
General code style and feature fixes.
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user