22 references to HasOneItem
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (22)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (22)
71
if (
HasOneItem
)
88
=>
HasOneItem
? 1 : _many.Length;
94
=>
HasOneItem
? OneOrMany.Create(_one, item) :
100
if (
HasOneItem
)
111
=>
HasOneItem
? EqualityComparer<T>.Default.Equals(item, _one) : _many.Contains(item);
115
if (
HasOneItem
)
125
return
HasOneItem
?
132
return
HasOneItem
?
140
=>
HasOneItem
? _one : _many.FirstOrDefault();
144
if (
HasOneItem
)
154
if (
HasOneItem
)
164
return from.
HasOneItem
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();
199
Debug.Assert(
HasOneItem
== other.
HasOneItem
);
201
return
HasOneItem
? comparer.Equals(_one, other._one!) :
212
if (!
HasOneItem
)