[tools] Use Extensions.Is instead of Extensions.IsPlatformType. (#9530)

The latter just calls the former.
This commit is contained in:
Rolf Bjarne Kvinge 2020-08-27 20:02:30 +02:00 коммит произвёл GitHub
Родитель 48090369db
Коммит 84758616ce
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 6 добавлений и 10 удалений

Просмотреть файл

@ -6,6 +6,7 @@ using System.IO;
using System.Linq;
using System.Xml;
using Mono.Cecil;
using Mono.Tuner;
using MonoTouch.Tuner;
using ObjCRuntime;
using Xamarin;
@ -243,7 +244,7 @@ namespace Xamarin.Bundler {
continue;
TypeReference type = attr.Constructor.DeclaringType;
if (!type.IsPlatformType ("ObjCRuntime", "LinkWithAttribute"))
if (!type.Is ("ObjCRuntime", "LinkWithAttribute"))
continue;
// Let the linker remove it the attribute from the assembly

Просмотреть файл

@ -21,10 +21,5 @@ namespace MonoTouch.Tuner {
return null;
}
public static bool IsPlatformType (this TypeReference type, string @namespace, string name)
{
return type.Is (@namespace, name);
}
}
}

Просмотреть файл

@ -32,7 +32,7 @@ namespace Xamarin.Linker.Steps
// We don't need to process assemblies that don't reference ObjCRuntime.BindAsAttribute.
foreach (var tr in assembly.MainModule.GetTypeReferences ()) {
if (tr.IsPlatformType ("ObjCRuntime", "BindAsAttribute"))
if (tr.Is ("ObjCRuntime", "BindAsAttribute"))
return true;
}
@ -59,7 +59,7 @@ namespace Xamarin.Linker.Steps
foreach (var ca in provider.CustomAttributes) {
var tr = ca.Constructor.DeclaringType;
if (!tr.IsPlatformType ("ObjCRuntime", "BindAsAttribute"))
if (!tr.Is ("ObjCRuntime", "BindAsAttribute"))
continue;
if (ca.ConstructorArguments.Count != 1) {
@ -110,13 +110,13 @@ namespace Xamarin.Linker.Steps
if (!method.HasParameters || method.Parameters.Count != 1)
continue;
if (method.Name == "GetConstant") {
if (!method.ReturnType.IsPlatformType ("Foundation", "NSString"))
if (!method.ReturnType.Is ("Foundation", "NSString"))
continue;
if (method.Parameters [0].ParameterType != managedEnumType)
continue;
getConstant = method;
} else if (method.Name == "GetValue") {
if (!method.Parameters [0].ParameterType.IsPlatformType ("Foundation", "NSString"))
if (!method.Parameters [0].ParameterType.Is ("Foundation", "NSString"))
continue;
if (method.ReturnType != managedEnumType)
continue;