1 write to _source
System.Linq (1)
System\Linq\Shuffle.SpeedOpt.cs (1)
104
_source
= source;
13 references to _source
System.Linq (13)
System\Linq\Shuffle.SpeedOpt.cs (13)
108
private protected override Iterator<TSource> Clone() => new ShuffleTakeIterator<TSource>(
_source
, _takeCount);
130
List<TSource>? buffer = SampleToList(
_source
, _takeCount, out _);
149
public override TSource[] ToArray() => SampleToList(
_source
, _takeCount, out _)?.ToArray() ?? [];
151
public override List<TSource> ToList() => SampleToList(
_source
, _takeCount, out _) ?? [];
154
TryGetNonEnumeratedCount(
_source
, out int count) ? Math.Min(_takeCount, count) :
155
!onlyIfCheap ?
_source
.Take(_takeCount).Count() :
166
if (
_source
is Iterator<TSource> iterator &&
175
else if (
_source
is IList<TSource> list)
186
List<TSource>? sample = SampleToList(
_source
, 1, out long totalElementCount);
199
_takeCount <= count ? this : new ShuffleTakeIterator<TSource>(
_source
, count);
292
if (
_source
is IList<TSource> list)
315
else if (
_source
is Iterator<TSource> iterator &&
336
foreach (TSource item in
_source
)