1 write to _source
System.Linq (1)
System\Linq\AppendPrepend.cs (1)
47
_source
= source;
29 references to _source
System.Linq (29)
System\Linq\AppendPrepend.cs (9)
53
_enumerator =
_source
.GetEnumerator();
101
private protected override Iterator<TSource> Clone() => new AppendPrepend1Iterator<TSource>(
_source
, _item, _appending);
143
return new AppendPrependN<TSource>(
_source
, null, new SingleLinkedNode<TSource>(_item).Add(item), prependCount: 0, appendCount: 2);
147
return new AppendPrependN<TSource>(
_source
, new SingleLinkedNode<TSource>(_item), new SingleLinkedNode<TSource>(item), prependCount: 1, appendCount: 1);
155
return new AppendPrependN<TSource>(
_source
, new SingleLinkedNode<TSource>(item), new SingleLinkedNode<TSource>(_item), prependCount: 1, appendCount: 1);
159
return new AppendPrependN<TSource>(
_source
, new SingleLinkedNode<TSource>(_item).Add(item), null, prependCount: 2, appendCount: 0);
191
private protected override Iterator<TSource> Clone() => new AppendPrependN<TSource>(
_source
, _prepended, _appended, _prependCount, _appendCount);
237
return new AppendPrependN<TSource>(
_source
, _prepended, appended, _prependCount, _appendCount + 1);
243
return new AppendPrependN<TSource>(
_source
, prepended, _appended, _prependCount + 1, _appendCount);
System\Linq\AppendPrepend.SpeedOpt.cs (20)
18
if (
_source
is ICollection<TSource> c)
41
builder.AddNonICollectionRange(
_source
);
47
builder.AddNonICollectionRange(
_source
);
77
if (
_source
is ICollection<TSource> collection)
83
foreach (TSource item in
_source
)
113
list.AddRange(
_source
);
124
if (
_source
is Iterator<TSource> iterator)
130
return !onlyIfCheap ||
_source
is ICollection<TSource> ?
_source
.Count() + 1 : -1;
137
TSource? first =
_source
.TryGetFirst(out found);
152
TSource? last =
_source
.TryGetLast(out found);
174
return
_source
.TryGetElementAt(index, out found);
187
if (
_source
is ICollection<TSource> c)
208
builder.AddNonICollectionRange(
_source
);
234
if (
_source
is ICollection<TSource> sourceCollection)
240
foreach (TSource item in
_source
)
264
list.AddRange(
_source
);
273
if (
_source
is Iterator<TSource> iterator)
279
return !onlyIfCheap ||
_source
is ICollection<TSource> ?
_source
.Count() + _appendCount + _prependCount : -1;