From 293f340f20fa512782782b304ecc5e4ea8770b1b Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 15 Apr 2019 16:29:41 -0700 Subject: [PATCH] Remove redundant UnderlyingSystemType calls (dotnet/coreclr#24000) UnderlyingSystemType is virtual Commit migrated from https://github.com/dotnet/coreclr/commit/a6326409fd033f4145e1387955504d46f50850a5 --- src/libraries/System.Private.CoreLib/src/System/Type.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Type.cs b/src/libraries/System.Private.CoreLib/src/System/Type.cs index 8b19fbc..d2a31cb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Type.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Type.cs @@ -281,8 +281,9 @@ namespace System } protected virtual TypeCode GetTypeCodeImpl() { - if (this != UnderlyingSystemType && UnderlyingSystemType != null) - return Type.GetTypeCode(UnderlyingSystemType); + Type systemType = UnderlyingSystemType; + if (this != systemType && systemType != null) + return Type.GetTypeCode(systemType); return TypeCode.Object; } -- 2.7.4