Replace Single
with First
when we know the element count is 1 (#15676)
This commit is contained in:
parent
7a39acb527
commit
1e992c5e53
|
@ -105,7 +105,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
|
||||
if (cmdletOutput.Count == 1)
|
||||
{
|
||||
var singleOutputParameter = cmdletOutput.Values.Single();
|
||||
var singleOutputParameter = cmdletOutput.Values.First();
|
||||
if (singleOutputParameter.Value == null)
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -202,7 +202,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
|
||||
if (valueBehaviors.Count == 1)
|
||||
{
|
||||
this.BehaviorOnNoMatch = valueBehaviors.Single();
|
||||
this.BehaviorOnNoMatch = valueBehaviors.First();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1983,7 +1983,7 @@ Microsoft.PowerShell.Core\Export-ModuleMember -Function '{1}' -Alias '*'
|
|||
}
|
||||
else if (queryParameterSets.Count == 1)
|
||||
{
|
||||
commandMetadata.DefaultParameterSetName = queryParameterSets.Single();
|
||||
commandMetadata.DefaultParameterSetName = queryParameterSets[0];
|
||||
}
|
||||
|
||||
AddPassThruParameter(commonParameters, instanceCmdlet);
|
||||
|
|
Loading…
Reference in a new issue