Use '==' instead of 'Equals()' to test type equality in ServiceIdentifier (#90334)
authorBenjamin Petit <benjaminpetit@users.noreply.github.com>
Mon, 14 Aug 2023 19:47:41 +0000 (21:47 +0200)
committerGitHub <noreply@github.com>
Mon, 14 Aug 2023 19:47:41 +0000 (21:47 +0200)
src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceIdentifier.cs

index c1e1c5d42bddba907e68af1dc58b81ba6a803ebf..0b87443248ad9de07498d412be11e449ac4fa7d1 100644 (file)
@@ -32,11 +32,11 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
         {
             if (ServiceKey == null && other.ServiceKey == null)
             {
-                return ServiceType.Equals(other.ServiceType);
+                return ServiceType == other.ServiceType;
             }
             else if (ServiceKey != null && other.ServiceKey != null)
             {
-                return ServiceType.Equals(other.ServiceType) && ServiceKey.Equals(other.ServiceKey);
+                return ServiceType == other.ServiceType && ServiceKey.Equals(other.ServiceKey);
             }
             return false;
         }