1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00

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
@@ -13,8 +13,10 @@ namespace NzbDrone.Common.Extensions
return source.Where(element => knownKeys.Add(keySelector(element)));
}
public static IEnumerable<TFirst> IntersectBy<TFirst, TSecond, TKey>(this IEnumerable<TFirst> first, Func<TFirst, TKey> firstKeySelector,
IEnumerable<TSecond> second, Func<TSecond, TKey> secondKeySelector,
public static IEnumerable<TFirst> IntersectBy<TFirst, TSecond, TKey>(this IEnumerable<TFirst> first,
Func<TFirst, TKey> firstKeySelector,
IEnumerable<TSecond> second,
Func<TSecond, TKey> secondKeySelector,
IEqualityComparer<TKey> keyComparer)
{
var keys = new HashSet<TKey>(second.Select(secondKeySelector), keyComparer);
@@ -31,9 +33,11 @@ namespace NzbDrone.Common.Extensions
}
}
public static IEnumerable<TFirst> ExceptBy<TFirst, TSecond, TKey>(this IEnumerable<TFirst> first, Func<TFirst, TKey> firstKeySelector,
IEnumerable<TSecond> second, Func<TSecond, TKey> secondKeySelector,
IEqualityComparer<TKey> keyComparer)
public static IEnumerable<TFirst> ExceptBy<TFirst, TSecond, TKey>(this IEnumerable<TFirst> first,
Func<TFirst, TKey> firstKeySelector,
IEnumerable<TSecond> second,
Func<TSecond, TKey> secondKeySelector,
IEqualityComparer<TKey> keyComparer)
{
var keys = new HashSet<TKey>(second.Select(secondKeySelector), keyComparer);
var matchedKeys = new HashSet<TKey>();
@@ -62,6 +66,7 @@ namespace NzbDrone.Common.Extensions
result[key] = item;
}
}
return result;
}
@@ -76,6 +81,7 @@ namespace NzbDrone.Common.Extensions
result[key] = valueSelector(item);
}
}
return result;
}
@@ -112,11 +118,15 @@ namespace NzbDrone.Common.Extensions
public static IEnumerable<T> DropLast<T>(this IEnumerable<T> source, int n)
{
if (source == null)
{
throw new ArgumentNullException("source");
}
if (n < 0)
{
throw new ArgumentOutOfRangeException("n",
"Argument n should be non-negative.");
}
return InternalDropLast(source, n);
}
@@ -130,9 +140,12 @@ namespace NzbDrone.Common.Extensions
buffer.Enqueue(x);
if (buffer.Count == n + 1)
{
yield return buffer.Dequeue();
}
}
}
public static bool In<T>(this T source, List<T> list)
{
return list.Contains(source);