Reformat and apply Stylecop rules

This commit is contained in:
ta264
2019-12-22 22:08:53 +00:00
committed by Qstick
parent d4fa9b7345
commit f02fa629cc
1186 changed files with 7105 additions and 5616 deletions

View File

@@ -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)