mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
refactor: Removing redundant code
This commit is contained in:
@@ -106,24 +106,6 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
if (comparer == null)
|
if (comparer == null)
|
||||||
throw new ArgumentNullException("comparer");
|
throw new ArgumentNullException("comparer");
|
||||||
|
|
||||||
if (extends.Count == 0)
|
|
||||||
{
|
|
||||||
extends.Add(item);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (comparer.Compare(extends[extends.Count - 1], item) <= 0)
|
|
||||||
{
|
|
||||||
extends.Add(item);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (comparer.Compare(extends[0], item) >= 0)
|
|
||||||
{
|
|
||||||
extends.Insert(0, item);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = extends.BinarySearch(item, comparer);
|
int index = extends.BinarySearch(item, comparer);
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = ~index;
|
index = ~index;
|
||||||
|
|||||||
Reference in New Issue
Block a user