mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-27 11:56:14 +08:00
Fix RCS1215: Expression is always equal to true/false (#14356)
* Fix RCS1215: Expression is always equal to true/false
This commit is contained in:
parent
ef187d94f3
commit
68821932c5
@ -107,7 +107,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
// may be getting piped in.
|
||||
bool result = true;
|
||||
|
||||
if (paths != null && paths.Length >= 0)
|
||||
if (paths != null)
|
||||
{
|
||||
foreach (string path in paths)
|
||||
{
|
||||
|
@ -252,7 +252,7 @@ namespace Microsoft.PowerShell
|
||||
// choices to be picked.
|
||||
|
||||
// user did not pick up any choices..choose the default
|
||||
if ((result.Count == 0) && (defaultChoiceKeys.Keys.Count >= 0))
|
||||
if (result.Count == 0)
|
||||
{
|
||||
// if there's a default, pick that one.
|
||||
foreach (int defaultChoice in defaultChoiceKeys.Keys)
|
||||
|
@ -2010,16 +2010,14 @@ namespace Microsoft.PowerShell.Commands
|
||||
//
|
||||
// Thus lengths 1 & 2 are container items.
|
||||
//
|
||||
isContainer = (pathElements.Length >= 0) &&
|
||||
(pathElements.Length <= 2);
|
||||
isContainer = pathElements.Length <= 2;
|
||||
|
||||
X509NativeStore store = null;
|
||||
|
||||
//
|
||||
// handle invalid path depth
|
||||
//
|
||||
if ((pathElements.Length > 3) ||
|
||||
(pathElements.Length < 0))
|
||||
if (pathElements.Length > 3)
|
||||
{
|
||||
if (test)
|
||||
{
|
||||
|
@ -993,7 +993,7 @@ namespace System.Management.Automation.Internal.Host
|
||||
// choices to be picked.
|
||||
|
||||
// user did not pick up any choices..choose the default
|
||||
if ((result.Count == 0) && (defaultChoiceKeys.Keys.Count >= 0))
|
||||
if (result.Count == 0)
|
||||
{
|
||||
// if there's a default, pick that one.
|
||||
foreach (int defaultChoice in defaultChoiceKeys.Keys)
|
||||
|
Loading…
Reference in New Issue
Block a user