3 writes to _many
Microsoft.CodeAnalysis (3)
InternalUtilities\OneOrMany.cs (3)
35
_many
= default;
48
_many
= default;
53
_many
= many;
23 references to _many
Microsoft.CodeAnalysis (23)
InternalUtilities\OneOrMany.cs (23)
62
=>
_many
.IsDefault;
65
=> _one == null &&
_many
.IsDefault;
82
return
_many
[index];
88
=> HasOneItem ? 1 :
_many
.Length;
96
OneOrMany.Create(
_many
.Add(item));
106
builder.AddRange(
_many
);
111
=> HasOneItem ? EqualityComparer<T>.Default.Equals(item, _one) :
_many
.Contains(item);
120
return OneOrMany.Create(
_many
.WhereAsArray(static (value, item) => !EqualityComparer<T>.Default.Equals(value, item), item));
127
OneOrMany.Create(
_many
.SelectAsArray(selector));
134
OneOrMany.Create(
_many
.SelectAsArray(selector, arg));
140
=> HasOneItem ? _one :
_many
.FirstOrDefault();
149
return
_many
.FirstOrDefault(predicate);
159
return
_many
.FirstOrDefault(predicate, arg);
166
: new OneOrMany<T>(ImmutableArray<T>.CastUp(from.
_many
));
170
=> HasOneItem ? predicate(_one) :
_many
.All(predicate);
173
=> HasOneItem ? predicate(_one, arg) :
_many
.All(predicate, arg);
179
=> HasOneItem ? predicate(_one) :
_many
.Any(predicate);
182
=> HasOneItem ? predicate(_one, arg) :
_many
.Any(predicate, arg);
185
=> HasOneItem ? ImmutableArray.Create(_one) :
_many
;
188
=> HasOneItem ? new[] { _one } :
_many
.ToArray();
202
System.Linq.ImmutableArrayExtensions.SequenceEqual(
_many
, other.
_many
, comparer);
214
return
_many
.SequenceEqual(other, comparer);