[linker] Remove new memory allocations (List) in the sealer

This commit is contained in:
Sebastien Pouliot 2019-04-05 14:01:44 -05:00
Родитель c055db4ddc
Коммит d66375d275
1 изменённых файлов: 12 добавлений и 2 удалений

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

@ -1,7 +1,6 @@
// Copyright 2016 Xamarin Inc. All rights reserved. // Copyright 2016 Xamarin Inc. All rights reserved.
using System; using System;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using Mono.Cecil; using Mono.Cecil;
using Mono.Linker; using Mono.Linker;
@ -85,7 +84,7 @@ namespace Xamarin.Linker.Steps {
// sanity (disable IsSealed == true above) // sanity (disable IsSealed == true above)
//if (type.IsSealed) //if (type.IsSealed)
// Console.WriteLine (); // Console.WriteLine ();
if (AreMarked (overrides.Select (x => x.Override).ToList ())) if (AreMarked (overrides))
continue; continue;
} }
@ -110,6 +109,17 @@ namespace Xamarin.Linker.Steps {
} }
} }
bool AreMarked (List<OverrideInformation> list)
{
if (list == null)
return false;
foreach (var m in list) {
if (Annotations.IsMarked (m.Override))
return true;
}
return false;
}
bool AreMarked (List<MethodDefinition> list) bool AreMarked (List<MethodDefinition> list)
{ {
if (list == null) if (list == null)