Skip to content

Commit 154e70f

Browse files
committed
Merge branch 'main' into dev/grendel/cpp-tweaks
* main: [Xamarin.Android.Build.Tasks] `FixAbstractMethodsStep` performance (#8650)
2 parents 1216016 + 526172b commit 154e70f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixAbstractMethodsStep.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ bool MightNeedFix (TypeDefinition type)
141141
return !type.IsAbstract && type.IsSubclassOf ("Java.Lang.Object", cache);
142142
}
143143

144-
static bool CompareTypes (TypeReference iType, TypeReference tType)
144+
bool CompareTypes (TypeReference iType, TypeReference tType)
145145
{
146146
if (iType.IsGenericParameter)
147147
return true;
@@ -164,11 +164,11 @@ static bool CompareTypes (TypeReference iType, TypeReference tType)
164164
if (iType.Namespace != tType.Namespace)
165165
return false;
166166

167-
TypeDefinition iTypeDef = iType.Resolve ();
167+
TypeDefinition iTypeDef = cache.Resolve (iType);
168168
if (iTypeDef == null)
169169
return false;
170170

171-
TypeDefinition tTypeDef = tType.Resolve ();
171+
TypeDefinition tTypeDef = cache.Resolve (tType);
172172
if (tTypeDef == null)
173173
return false;
174174

@@ -198,7 +198,7 @@ bool IsInOverrides (MethodDefinition iMethod, MethodDefinition tMethod)
198198
return false;
199199

200200
foreach (var o in tMethod.Overrides)
201-
if (o != null && iMethod == o.Resolve ())
201+
if (o != null && iMethod.Name == o.Name && iMethod == cache.Resolve (o))
202202
return true;
203203

204204
return false;
@@ -252,7 +252,7 @@ bool FixAbstractMethods (TypeDefinition type)
252252

253253
foreach (var ifaceInfo in type.Interfaces) {
254254
var iface = ifaceInfo.InterfaceType;
255-
var ifaceDef = iface.Resolve ();
255+
var ifaceDef = cache.Resolve (iface);
256256
if (ifaceDef == null) {
257257
LogMessage ($"Unable to unresolve interface: {iface.FullName}");
258258
continue;

0 commit comments

Comments
 (0)