From 830f0cca7d7eaa62b432458ee72a944f2e9f20a2 Mon Sep 17 00:00:00 2001 From: walon Date: Fri, 23 Sep 2022 18:09:14 +0800 Subject: [PATCH] =?UTF-8?q?[opt]=20=E7=94=9F=E6=88=90=E7=9A=84=20AOTGeneri?= =?UTF-8?q?cReferences=20=E6=96=87=E4=BB=B6=E4=B8=AD=E6=B3=9B=E5=9E=8B?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=92=8C=E5=87=BD=E6=95=B0=E6=8C=89=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/AOT/GenericReferenceWriter.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Editor/AOT/GenericReferenceWriter.cs b/Editor/AOT/GenericReferenceWriter.cs index 89d337a..7fc577d 100644 --- a/Editor/AOT/GenericReferenceWriter.cs +++ b/Editor/AOT/GenericReferenceWriter.cs @@ -28,6 +28,7 @@ namespace HybridCLR.Editor.AOT codes.Add(""); codes.Add("\t// {{ AOT generic type"); + types.Sort((a, b) => a.Type.FullName.CompareTo(b.Type.FullName)); foreach(var type in types) { codes.Add($"\t//{type.ToTypeSig()}"); @@ -38,7 +39,16 @@ namespace HybridCLR.Editor.AOT codes.Add(""); codes.Add("\tpublic void RefMethods()"); codes.Add("\t{"); - + methods.Sort((a, b) => + { + int c = a.Method.DeclaringType.FullName.CompareTo(b.Method.DeclaringType.FullName); + if (c != 0) + { + return c; + } + c = a.Method.Name.CompareTo(b.Method.Name); + return c; + }); foreach(var method in methods) { codes.Add($"\t\t// {method.ToMethodSpec()}");