Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTlakaelel Axayakatl Ceja <tlakaelel_axayakatl@outlook.com>2022-09-01 23:02:43 +0300
committerGitHub <noreply@github.com>2022-09-01 23:02:43 +0300
commitab2d195f169a08bf8eb978b472b2d3aca61b0a46 (patch)
tree4e441a8841728347e13d9a14f0b457340d134ef1 /src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs
parent7a45201181d37329b7ab0bee541ed7c42b5d94b6 (diff)
Run code quality analyzers in the coreclr/tools directory (#74825)
Run codeanalysis analyzers in the coreclr/tools directory
Diffstat (limited to 'src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs')
-rw-r--r--src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs
index 91856de2d88..8f6cd67f9a6 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs
+++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
using System.Collections.Generic;
using Internal.TypeSystem;
@@ -165,7 +164,7 @@ namespace Internal.IL.Stubs
{
// This can be any of the comparers we have.
- ArrayBuilder<TypeDesc> universalComparers = new ArrayBuilder<TypeDesc>();
+ ArrayBuilder<TypeDesc> universalComparers = default(ArrayBuilder<TypeDesc>);
universalComparers.Add(context.SystemModule.GetKnownType("System.Collections.Generic", $"Nullable{flavor}`1")
.MakeInstantiatedType(type));
@@ -182,7 +181,7 @@ namespace Internal.IL.Stubs
return universalComparers.ToArray();
}
-
+
// This mirrors exactly what GetUnknownEquatableComparer and GetUnknownComparer (in the class library)
// will need at runtime. This is the general purpose code path that can be used to compare
// anything.
@@ -203,7 +202,7 @@ namespace Internal.IL.Stubs
.MakeInstantiatedType(type),
};
}
-
+
return new TypeDesc[]
{
context.SystemModule.GetKnownType("System.Collections.Generic", $"Generic{flavor}`1")
@@ -226,8 +225,7 @@ namespace Internal.IL.Stubs
if (interfaceInstantiation.Length == 1 &&
interfaceInstantiation[0] == type)
{
- if (interfaceType == null)
- interfaceType = type.Context.SystemModule.GetKnownType("System", interfaceName);
+ interfaceType ??= interfaceType = type.Context.SystemModule.GetKnownType("System", interfaceName);
if (implementedInterface.GetTypeDefinition() == interfaceType)
return true;