mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Refactor] Use collection expressions.
This commit is contained in:
@@ -35,11 +35,7 @@ public static partial class ArrayHelpers
|
||||
/// <param name="destinationArray">Array</param>
|
||||
/// <param name="value">Value</param>
|
||||
/// <typeparam name="T">Array type</typeparam>
|
||||
public static void ArrayFill<T>(T[] destinationArray, T value) => ArrayFill(destinationArray,
|
||||
new[]
|
||||
{
|
||||
value
|
||||
});
|
||||
public static void ArrayFill<T>(T[] destinationArray, T value) => ArrayFill(destinationArray, [value]);
|
||||
|
||||
/// <summary>Fills an array with the contents of the specified array</summary>
|
||||
/// <param name="destinationArray">Array</param>
|
||||
|
||||
@@ -328,12 +328,7 @@ public static class Marshal
|
||||
var flt = (float)(fi.GetValue(str) ?? default(float));
|
||||
byte[] flt_b = BitConverter.GetBytes(flt);
|
||||
|
||||
fi.SetValue(str,
|
||||
BitConverter.ToSingle(new[]
|
||||
{
|
||||
flt_b[3], flt_b[2], flt_b[1], flt_b[0]
|
||||
},
|
||||
0));
|
||||
fi.SetValue(str, BitConverter.ToSingle([flt_b[3], flt_b[2], flt_b[1], flt_b[0]], 0));
|
||||
}
|
||||
else if(fi.FieldType == typeof(double))
|
||||
{
|
||||
@@ -341,11 +336,10 @@ public static class Marshal
|
||||
byte[] dbl_b = BitConverter.GetBytes(dbl);
|
||||
|
||||
fi.SetValue(str,
|
||||
BitConverter.ToDouble(new[]
|
||||
{
|
||||
BitConverter.ToDouble([
|
||||
dbl_b[7], dbl_b[6], dbl_b[5], dbl_b[4], dbl_b[3], dbl_b[2],
|
||||
dbl_b[1], dbl_b[0]
|
||||
},
|
||||
],
|
||||
0));
|
||||
}
|
||||
else if(fi.FieldType == typeof(byte) || fi.FieldType == typeof(sbyte))
|
||||
|
||||
Reference in New Issue
Block a user