Fix RCS1215: Expression is always equal to true/false (#14356)

* Fix RCS1215: Expression is always equal to true/false
This commit is contained in:
xtqqczze 2021-01-19 11:03:59 +00:00 committed by GitHub
parent ef187d94f3
commit 68821932c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 7 deletions

View File

@ -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)
{

View File

@ -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)

View File

@ -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)
{

View File

@ -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)