Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryGetFirst< TSource >() [2/2]

static TSource System.Linq.Enumerable.TryGetFirst< TSource > ( this IEnumerable< TSource > source,
out bool found )
inlinestaticprivate

Definition at line 4885 of file Enumerable.cs.

4886 {
4887 if (source == null)
4888 {
4889 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
4890 }
4892 {
4893 return partition.TryGetFirst(out found);
4894 }
4896 {
4897 if (list.Count > 0)
4898 {
4899 found = true;
4900 return list[0];
4901 }
4902 }
4903 else
4904 {
4905 using IEnumerator<TSource> enumerator = source.GetEnumerator();
4906 if (enumerator.MoveNext())
4907 {
4908 found = true;
4909 return enumerator.Current;
4910 }
4911 }
4912 found = false;
4913 return default(TSource);
4914 }

References System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.list, System.Linq.source, and System.Linq.ThrowHelper.ThrowArgumentNullException().