3 writes to _many
Microsoft.CodeAnalysis.Workspaces (3)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (3)
35_many = default; 48_many = default; 53_many = many;
23 references to _many
Microsoft.CodeAnalysis.Workspaces (23)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (23)
62=> _many.IsDefault; 65=> _one == null && _many.IsDefault; 82return _many[index]; 88=> HasOneItem ? 1 : _many.Length; 96OneOrMany.Create(_many.Add(item)); 106builder.AddRange(_many); 111=> HasOneItem ? EqualityComparer<T>.Default.Equals(item, _one) : _many.Contains(item); 120return OneOrMany.Create(_many.WhereAsArray(static (value, item) => !EqualityComparer<T>.Default.Equals(value, item), item)); 127OneOrMany.Create(_many.SelectAsArray(selector)); 134OneOrMany.Create(_many.SelectAsArray(selector, arg)); 140=> HasOneItem ? _one : _many.FirstOrDefault(); 149return _many.FirstOrDefault(predicate); 159return _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(); 202System.Linq.ImmutableArrayExtensions.SequenceEqual(_many, other._many, comparer); 214return _many.SequenceEqual(other, comparer);