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

◆ ToLookup< TSource, TKey, TElement >() [2/2]

static ILookup< TKey, TElement > System.Linq.ParallelEnumerable.ToLookup< TSource, TKey, TElement > ( this ParallelQuery< TSource > source,
Func< TSource, TKey > keySelector,
Func< TSource, TElement > elementSelector,
IEqualityComparer< TKey >? comparer )
inlinestatic
Type Constraints
TKey :notnull 

Definition at line 1880 of file ParallelEnumerable.cs.

1880 : notnull
1881 {
1882 if (source == null)
1883 {
1884 throw new ArgumentNullException("source");
1885 }
1886 if (keySelector == null)
1887 {
1888 throw new ArgumentNullException("keySelector");
1889 }
1890 if (elementSelector == null)
1891 {
1892 throw new ArgumentNullException("elementSelector");
1893 }
1896 System.Linq.Parallel.Lookup<TKey, TElement> lookup = new System.Linq.Parallel.Lookup<TKey, TElement>(comparer);
1898 using (enumerator)
1899 {
1900 while (enumerator.MoveNext())
1901 {
1902 lookup.Add(enumerator.Current);
1903 }
1904 return lookup;
1905 }
1906 }
void Add(TKey key, TValue value)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.comparer, System.Linq.elementSelector, System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.Linq.keySelector, and System.Linq.source.