mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
Reformat and apply Stylecop rules
This commit is contained in:
@@ -18,7 +18,11 @@ namespace NzbDrone.Common.Extensions
|
||||
|
||||
public static object NullSafe(this object target)
|
||||
{
|
||||
if (target != null) return target;
|
||||
if (target != null)
|
||||
{
|
||||
return target;
|
||||
}
|
||||
|
||||
return "[NULL]";
|
||||
}
|
||||
|
||||
@@ -76,7 +80,9 @@ namespace NzbDrone.Common.Extensions
|
||||
public static string TrimEnd(this string text, string postfix)
|
||||
{
|
||||
if (text.EndsWith(postfix))
|
||||
{
|
||||
text = text.Substring(0, text.Length - postfix.Length);
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
@@ -134,7 +140,7 @@ namespace NzbDrone.Common.Extensions
|
||||
public static byte[] HexToByteArray(this string input)
|
||||
{
|
||||
return Enumerable.Range(0, input.Length)
|
||||
.Where(x => x%2 == 0)
|
||||
.Where(x => x % 2 == 0)
|
||||
.Select(x => Convert.ToByte(input.Substring(x, 2), 16))
|
||||
.ToArray();
|
||||
}
|
||||
@@ -151,9 +157,9 @@ namespace NzbDrone.Common.Extensions
|
||||
var first = int.Parse(octalValue.Substring(0, 1));
|
||||
var second = int.Parse(octalValue.Substring(1, 1));
|
||||
var third = int.Parse(octalValue.Substring(2, 1));
|
||||
var byteResult = (byte)((first << 6) | (second << 3) | (third));
|
||||
var byteResult = (byte)((first << 6) | (second << 3) | third);
|
||||
|
||||
return Encoding.ASCII.GetString(new [] { byteResult });
|
||||
return Encoding.ASCII.GetString(new[] { byteResult });
|
||||
}
|
||||
|
||||
public static string SplitCamelCase(this string input)
|
||||
|
Reference in New Issue
Block a user