cache tyoes

This commit is contained in:
LukeFZ
2023-11-29 21:19:41 +01:00
parent 96e466743d
commit 9f0d0476bb
2 changed files with 381 additions and 361 deletions

View File

@@ -36,8 +36,18 @@ namespace Il2CppInspector.Reflection
public Dictionary<string, TypeInfo> TypesByFullName { get; } = new Dictionary<string, TypeInfo>();
// Every type
public IEnumerable<TypeInfo> Types => TypesByDefinitionIndex.Concat(TypesByReferenceIndex)
.Concat(GenericMethods.Values.Select(m => m.DeclaringType)).Distinct().Where(t => t != null);
public IEnumerable<TypeInfo> Types
{
get
{
types ??= TypesByDefinitionIndex.Concat(TypesByReferenceIndex)
.Concat(GenericMethods.Values.Select(m => m.DeclaringType)).Distinct().Where(t => t != null).ToList();
return types;
}
}
private List<TypeInfo> types;
// List of all methods ordered by their MethodDefinitionIndex
public MethodBase[] MethodsByDefinitionIndex { get; }