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

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

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

Definition at line 5245 of file Enumerable.cs.

5246 {
5247 if (source == null)
5248 {
5249 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
5250 }
5252 {
5253 return partition.TryGetLast(out found);
5254 }
5256 {
5257 if (count > 0)
5258 {
5259 found = true;
5260 return list[count - 1];
5261 }
5262 }
5263 else
5264 {
5265 using IEnumerator<TSource> enumerator = source.GetEnumerator();
5266 if (enumerator.MoveNext())
5267 {
5268 TSource current;
5269 do
5270 {
5271 current = enumerator.Current;
5272 }
5273 while (enumerator.MoveNext());
5274 found = true;
5275 return current;
5276 }
5277 }
5278 found = false;
5279 return default(TSource);
5280 }

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