mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Replace Single with First when we know the element count is 1 (#15676)
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user