From 9a18cd87f9bf2299e86f9d8a7ae0b6bf11156c61 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 22 Aug 2017 15:17:11 -0700 Subject: [PATCH] Replace extension method 'IsComObject(this Type)' with Type.IsCOMObject --- src/System.Management.Automation/engine/CoreAdapter.cs | 4 ++-- src/System.Management.Automation/engine/MshObject.cs | 2 +- .../utils/ExtensionMethods.cs | 10 ---------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/System.Management.Automation/engine/CoreAdapter.cs b/src/System.Management.Automation/engine/CoreAdapter.cs index 4fbf9d629e7..8761a6ff9d5 100644 --- a/src/System.Management.Automation/engine/CoreAdapter.cs +++ b/src/System.Management.Automation/engine/CoreAdapter.cs @@ -2472,8 +2472,8 @@ internal PropertyCacheEntry(PropertyInfo property) if (declaringTypeInfo.IsValueType || propertyTypeInfo.IsGenericType || declaringTypeInfo.IsGenericType || - property.DeclaringType.IsComObject() || - property.PropertyType.IsComObject()) + property.DeclaringType.IsCOMObject || + property.PropertyType.IsCOMObject) { this.readOnly = property.GetSetMethod() == null; this.writeOnly = property.GetGetMethod() == null; diff --git a/src/System.Management.Automation/engine/MshObject.cs b/src/System.Management.Automation/engine/MshObject.cs index 6dd16ab05bd..822a26aaa85 100644 --- a/src/System.Management.Automation/engine/MshObject.cs +++ b/src/System.Management.Automation/engine/MshObject.cs @@ -463,7 +463,7 @@ internal static AdapterSet GetMappedAdapter(object obj, TypeTable typeTable) if (result == null) { - if (objectType.IsComObject()) + if (objectType.IsCOMObject) { // All WinRT types are COM types. // All WinRT types would contain the TypeAttributes flag being set to WindowsRunTime. diff --git a/src/System.Management.Automation/utils/ExtensionMethods.cs b/src/System.Management.Automation/utils/ExtensionMethods.cs index 2054f51b595..2ed40105724 100644 --- a/src/System.Management.Automation/utils/ExtensionMethods.cs +++ b/src/System.Management.Automation/utils/ExtensionMethods.cs @@ -118,16 +118,6 @@ internal static bool IsInteger(this Type type) return LanguagePrimitives.IsInteger(LanguagePrimitives.GetTypeCode(type)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static bool IsComObject(this Type type) - { -#if UNIX - return false; -#else - return type.IsCOMObject; -#endif - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static TypeCode GetTypeCode(this Type type) {