mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-13 10:48:26 -04:00
Applied codestyle to all .cs files
This commit is contained in:
@@ -5,7 +5,7 @@ namespace NadekoBot.Extensions;
|
||||
public static class ArrayExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new array from the old array + new element at the end
|
||||
/// Create a new array from the old array + new element at the end
|
||||
/// </summary>
|
||||
/// <param name="input">Input array</param>
|
||||
/// <param name="added">Item to add to the end of the output array</param>
|
||||
@@ -14,18 +14,13 @@ public static class ArrayExtensions
|
||||
public static T[] With<T>(this T[] input, T added)
|
||||
{
|
||||
var newCrs = new T[input.Length + 1];
|
||||
Array.Copy(input,
|
||||
0,
|
||||
newCrs,
|
||||
0,
|
||||
input.Length
|
||||
);
|
||||
Array.Copy(input, 0, newCrs, 0, input.Length);
|
||||
newCrs[input.Length] = added;
|
||||
return newCrs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new array by applying the specified function to every element in the input array
|
||||
/// Creates a new array by applying the specified function to every element in the input array
|
||||
/// </summary>
|
||||
/// <param name="arr">Array to modify</param>
|
||||
/// <param name="f">Function to apply</param>
|
||||
@@ -34,4 +29,4 @@ public static class ArrayExtensions
|
||||
/// <returns>New array with updated elements</returns>
|
||||
public static TOut[] Map<TIn, TOut>(this TIn[] arr, Func<TIn, TOut> f)
|
||||
=> Array.ConvertAll(arr, x => f(x));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user