Skip to content

Commit 72af9a5

Browse files
authored
[StyleCleanUp] Remove unnecessary equality operator (IDE0100) (#10643)
* Fix IDE0100 in PBT * Fix IDE0100 in PresentationCore * Fix IDE0100 in PresentationFramework * Fix IDE0100 in PresentationUI * Fix IDE0100 in ReachFramework * Fix IDE0100 in Ribbon * Fix IDE0100 in WindowsBase * Fix IDE0100 in System.Xaml * Fix IDE0100 in Shared files * Fix the rest of IDE0100 * Adjust .editorconfig * Fix whitespace issues * One more spacing issue
1 parent 6bc51a5 commit 72af9a5

File tree

185 files changed

+616
-626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+616
-626
lines changed

src/Microsoft.DotNet.Wpf/src/.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ dotnet_diagnostic.IDE0077.severity = suggestion
206206
# IDE0078: Use pattern matching
207207
dotnet_diagnostic.IDE0078.severity = suggestion
208208

209-
# IDE0100: Remove redundant equality
210-
dotnet_diagnostic.IDE0100.severity = suggestion
211-
212209
# IDE0180: Use tuple to swap values
213210
dotnet_diagnostic.IDE0180.severity = suggestion
214211

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/MarkupCompiler/MarkupCompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3353,7 +3353,7 @@ private string GetSplashResourceId()
33533353
relPath = TaskHelper.GetRootRelativePath(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, fullFilePath);
33543354
}
33553355

3356-
if (string.IsNullOrEmpty(relPath) == false)
3356+
if (!string.IsNullOrEmpty(relPath))
33573357
{
33583358
resourceId = relPath;
33593359
}

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/CompilerLocalReference.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
//----------------------------------------------------------------------------------------
@@ -173,7 +173,7 @@ internal void CleanupCache()
173173
//
174174
internal bool SaveCacheInformation(MarkupCompilePass1 mcPass1)
175175
{
176-
Debug.Assert(String.IsNullOrEmpty(_localCacheFile) != true, "_localCacheFile must not be empty.");
176+
Debug.Assert(!String.IsNullOrEmpty(_localCacheFile), "_localCacheFile must not be empty.");
177177
Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation.");
178178

179179
bool bSuccess = false;
@@ -235,7 +235,7 @@ internal bool SaveCacheInformation(MarkupCompilePass1 mcPass1)
235235
//
236236
internal bool LoadCacheFile()
237237
{
238-
Debug.Assert(String.IsNullOrEmpty(_localCacheFile) != true, "_localCacheFile must not be empty.");
238+
Debug.Assert(!String.IsNullOrEmpty(_localCacheFile), "_localCacheFile must not be empty.");
239239

240240
bool loadSuccess = false;
241241

@@ -261,7 +261,7 @@ internal bool LoadCacheFile()
261261

262262
ArrayList alMarkupPages = new ArrayList();
263263

264-
while (srCache.EndOfStream != true)
264+
while (!srCache.EndOfStream)
265265
{
266266
lineText = srCache.ReadLine();
267267
LocalReferenceFile lrf = LocalReferenceFile.Deserialize(lineText);

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/CompilerState.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
//----------------------------------------------------------------------------------------
@@ -87,7 +87,7 @@ internal void CleanupCache()
8787

8888
internal bool SaveStateInformation(MarkupCompilePass1 mcPass1)
8989
{
90-
Debug.Assert(String.IsNullOrEmpty(_stateFilePath) != true, "StateFilePath must not be empty.");
90+
Debug.Assert(!String.IsNullOrEmpty(_stateFilePath), "StateFilePath must not be empty.");
9191
Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation.");
9292
Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated.");
9393

@@ -148,7 +148,7 @@ internal bool SaveStateInformation()
148148
//
149149
internal bool LoadStateInformation( )
150150
{
151-
Debug.Assert(String.IsNullOrEmpty(_stateFilePath) != true, "_stateFilePath must be not be empty.");
151+
Debug.Assert(!String.IsNullOrEmpty(_stateFilePath), "_stateFilePath must be not be empty.");
152152
Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated.");
153153

154154
bool loadSuccess = false;
@@ -176,7 +176,7 @@ internal bool LoadStateInformation( )
176176

177177
int i = 0;
178178

179-
while (srCache.EndOfStream != true)
179+
while (!srCache.EndOfStream)
180180
{
181181
if (i >= (int)CompilerStateType.MaxCount)
182182
{

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/MS/Internal/Tasks/TaskHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
//-----------------------------------------------------------------------------
@@ -207,7 +207,7 @@ internal static string GetWholeExceptionMessage(Exception exception)
207207
e = eInner;
208208
}
209209

210-
if (message != null && message.EndsWith(".", StringComparison.Ordinal) == false)
210+
if (message != null && !message.EndsWith(".", StringComparison.Ordinal))
211211
{
212212
message += ".";
213213
}

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/FileClassifier.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public override bool Execute()
7777

7878
ret = VerifyTaskInputs();
7979

80-
if (ret != false)
80+
if (ret)
8181
{
8282
// Do the real work to classify input files.
8383
Classify(SourceFiles, mainEmbeddedList, satelliteEmbeddedList);
@@ -276,7 +276,7 @@ private bool VerifyTaskInputs()
276276
// MSBUILD Engine should have checked the setting for this property
277277
// so don't need to recheck here.
278278

279-
if (TaskHelper.IsValidCultureName(Culture) == false)
279+
if (!TaskHelper.IsValidCultureName(Culture))
280280
{
281281
Log.LogErrorWithCodeFromResources(nameof(SR.InvalidCulture), Culture);
282282
bValidInput = false;

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/GenerateTemporaryTargetAssembly.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ private void RemoveEntityByName(XmlDocument xmlProjectDoc, string sItemName, str
618618

619619
XmlNode root = xmlProjectDoc.DocumentElement;
620620

621-
if (root.HasChildNodes == false)
621+
if (!root.HasChildNodes)
622622
{
623623
// If there is no child element in this project file, just return immediatelly.
624624
return;

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass1.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ private bool IsSupportedOutputType(string outputType)
973973
break;
974974
}
975975

976-
if (isSupported == false)
976+
if (!isSupported)
977977
{
978978
Log.LogErrorWithCodeFromResources(nameof(SR.TargetIsNotSupported), outputType);
979979

@@ -1019,7 +1019,7 @@ private bool VerifyInputTaskItems(ITaskItem[] inputItems)
10191019

10201020
bValidItem = IsValidInputFile(inputItem.ItemSpec);
10211021

1022-
if (bValidItem == false)
1022+
if (!bValidItem)
10231023
{
10241024
bValid = false;
10251025
}

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ private bool IsSupportedOutputType(string outputType)
817817
break;
818818
}
819819

820-
if (isSupported == false)
820+
if (!isSupported)
821821
{
822822
Log.LogErrorWithCodeFromResources(nameof(SR.TargetIsNotSupported), outputType);
823823

src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/ResourcesGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public override bool Execute()
146146
// Validate the property settings
147147
//
148148

149-
if (ValidResourceFiles(ResourceFiles) == false)
149+
if (!ValidResourceFiles(ResourceFiles))
150150
{
151151
// ValidResourceFiles has already showed up error message.
152152
// Just stop here.

0 commit comments

Comments
 (0)