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>
|
/// <typeparam name="T">Array type</typeparam>
|
||||||
public static void ArrayFill<T>(T[] destinationArray, T[] value)
|
public static void ArrayFill<T>(T[] destinationArray, T[] value)
|
||||||
{
|
{
|
||||||
if(destinationArray == null)
|
ArgumentNullException.ThrowIfNull(destinationArray);
|
||||||
throw new ArgumentNullException(nameof(destinationArray));
|
|
||||||
|
|
||||||
if(value.Length > destinationArray.Length)
|
if(value.Length > destinationArray.Length)
|
||||||
throw new ArgumentException("Length of value array must not be more than length of destination");
|
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>
|
/// <summary>Converts a LIF timestamp to .NET DateTime</summary>
|
||||||
/// <param name="date">LIF timestamp</param>
|
/// <param name="date">LIF timestamp</param>
|
||||||
/// <returns>.NET DateTime</returns>
|
/// <returns>.NET DateTime</returns>
|
||||||
public static DateTime LifToDateTime(byte[] date)
|
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],
|
||||||
if(date is not { Length: 6 })
|
date[4], date[5]);
|
||||||
return new DateTime(1970, 1, 1, 0, 0, 0);
|
|
||||||
|
|
||||||
return LifToDateTime(date[0], date[1], date[2], date[3], date[4], date[5]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Converts a LIF timestamp to .NET DateTime</summary>
|
/// <summary>Converts a LIF timestamp to .NET DateTime</summary>
|
||||||
/// <param name="year">Yer</param>
|
/// <param name="year">Yer</param>
|
||||||
|
|||||||
Reference in New Issue
Block a user