mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
fix: Fixing dumb mistake in TryFirst and TryLast extensions
This commit is contained in:
@@ -79,15 +79,6 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
|
|
||||||
item = default(T);
|
item = default(T);
|
||||||
|
|
||||||
IList<T> list = extends as IList<T>;
|
|
||||||
if (list != null)
|
|
||||||
{
|
|
||||||
if (list.Count <= 0)
|
|
||||||
return false;
|
|
||||||
item = list[0];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (IEnumerator<T> iterator = extends.GetEnumerator())
|
using (IEnumerator<T> iterator = extends.GetEnumerator())
|
||||||
{
|
{
|
||||||
while (iterator.MoveNext())
|
while (iterator.MoveNext())
|
||||||
@@ -135,16 +126,6 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
throw new ArgumentNullException("predicate");
|
throw new ArgumentNullException("predicate");
|
||||||
|
|
||||||
item = default(T);
|
item = default(T);
|
||||||
|
|
||||||
IList<T> list = extends as IList<T>;
|
|
||||||
if (list != null)
|
|
||||||
{
|
|
||||||
if (list.Count <= 0)
|
|
||||||
return false;
|
|
||||||
item = list[list.Count - 1];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool output = false;
|
bool output = false;
|
||||||
|
|
||||||
using (IEnumerator<T> iterator = extends.GetEnumerator())
|
using (IEnumerator<T> iterator = extends.GetEnumerator())
|
||||||
|
|||||||
Reference in New Issue
Block a user