Skip to content

Commit

Permalink
Merge branch 'main' into dev/grendel/cpp-tweaks
Browse files Browse the repository at this point in the history
* main:
  [Xamarin.Android.Build.Tasks] `FixAbstractMethodsStep` performance (#8650)
  • Loading branch information
grendello committed Feb 7, 2024
2 parents 1216016 + 526172b commit 154e70f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ bool MightNeedFix (TypeDefinition type)
return !type.IsAbstract && type.IsSubclassOf ("Java.Lang.Object", cache);
}

static bool CompareTypes (TypeReference iType, TypeReference tType)
bool CompareTypes (TypeReference iType, TypeReference tType)
{
if (iType.IsGenericParameter)
return true;
Expand All @@ -164,11 +164,11 @@ static bool CompareTypes (TypeReference iType, TypeReference tType)
if (iType.Namespace != tType.Namespace)
return false;

TypeDefinition iTypeDef = iType.Resolve ();
TypeDefinition iTypeDef = cache.Resolve (iType);
if (iTypeDef == null)
return false;

TypeDefinition tTypeDef = tType.Resolve ();
TypeDefinition tTypeDef = cache.Resolve (tType);
if (tTypeDef == null)
return false;

Expand Down Expand Up @@ -198,7 +198,7 @@ bool IsInOverrides (MethodDefinition iMethod, MethodDefinition tMethod)
return false;

foreach (var o in tMethod.Overrides)
if (o != null && iMethod == o.Resolve ())
if (o != null && iMethod.Name == o.Name && iMethod == cache.Resolve (o))
return true;

return false;
Expand Down Expand Up @@ -252,7 +252,7 @@ bool FixAbstractMethods (TypeDefinition type)

foreach (var ifaceInfo in type.Interfaces) {
var iface = ifaceInfo.InterfaceType;
var ifaceDef = iface.Resolve ();
var ifaceDef = cache.Resolve (iface);
if (ifaceDef == null) {
LogMessage ($"Unable to unresolve interface: {iface.FullName}");
continue;
Expand Down

0 comments on commit 154e70f

Please sign in to comment.