3 writes to _one
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (3)
34_one = one; 47_one = item; 52_one = default;
25 references to _one
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (25)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (25)
58/// True if the collection has a single item. This item is stored in <see cref="_one"/>. 60[MemberNotNullWhen(true, nameof(_one))] 65=> _one == null && _many.IsDefault; 78return _one; 94=> HasOneItem ? OneOrMany.Create(_one, item) : 102builder.Add(_one); 111=> HasOneItem ? EqualityComparer<T>.Default.Equals(item, _one) : _many.Contains(item); 117return EqualityComparer<T>.Default.Equals(item, _one) ? Empty : this; 126OneOrMany.Create(selector(_one)) : 133OneOrMany.Create(selector(_one, arg)) : 140=> HasOneItem ? _one : _many.FirstOrDefault(); 146return predicate(_one) ? _one : default; 156return predicate(_one, arg) ? _one : default; 165? new OneOrMany<T>(from._one) 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(); 201return HasOneItem ? comparer.Equals(_one, other._one!) : 220if (!first || !comparer.Equals(_one, otherItem))