@@ -180,12 +180,12 @@ private void ProduceStringArrays(int caret = -1, List<SMFunction> currentFunctio
180180 }
181181 }
182182
183- public List < ACNode > ProduceACNodes ( )
183+ public void ProduceACNodes ( List < ACNode > nodes )
184184 {
185- var nodes = new List < ACNode >
186- {
187- Capacity = Enums . Count + Structs . Count + ConstVariables . Count + Functions . Count
188- } ;
185+
186+ nodes . Clear ( ) ;
187+
188+ nodes . Capacity = Enums . Count + Structs . Count + ConstVariables . Count + Functions . Count ;
189189 nodes . AddRange ( ACNode . ConvertFromStringArray ( FunctionStrings , true , "▲ " ) ) ;
190190 nodes . AddRange ( ACNode . ConvertFromStringList ( TypeStrings , false , "♦ " ) ) ;
191191 nodes . AddRange ( ACNode . ConvertFromStringList ( Constants , false , "• " ) ) ;
@@ -196,8 +196,6 @@ public List<ACNode> ProduceACNodes()
196196
197197 //nodes = nodes.Distinct(new ACNodeEqualityComparer()).ToList(); Methodmaps and Functions can and will be the same.
198198 nodes . Sort ( ( a , b ) => string . CompareOrdinal ( a . EntryName , b . EntryName ) ) ;
199-
200- return nodes ;
201199 }
202200
203201 public void MergeDefinitions ( SMDefinition def )
@@ -341,9 +339,9 @@ public int GetHashCode(ACNode node)
341339
342340 public class ACNode
343341 {
342+ private string Prefix ;
344343 public string EntryName ;
345344 public bool IsExecutable ;
346- private string _name ;
347345
348346 public static List < ACNode > ConvertFromStringArray ( string [ ] strings , bool executable , string prefix = "" )
349347 {
@@ -352,7 +350,7 @@ public static List<ACNode> ConvertFromStringArray(string[] strings, bool executa
352350 for ( var i = 0 ; i < length ; ++ i )
353351 {
354352 nodeList . Add (
355- new ACNode { _name = prefix + strings [ i ] , EntryName = strings [ i ] , IsExecutable = executable } ) ;
353+ new ACNode { Prefix = prefix , EntryName = strings [ i ] , IsExecutable = executable } ) ;
356354 }
357355
358356 return nodeList ;
@@ -361,9 +359,9 @@ public static List<ACNode> ConvertFromStringArray(string[] strings, bool executa
361359 public static IEnumerable < ACNode > ConvertFromStringList ( IEnumerable < string > strings , bool executable ,
362360 string prefix = "" , bool addSpace = false )
363361 {
364- return strings . Select ( e => new ACNode { _name = prefix + e , EntryName = e , IsExecutable = executable } ) ;
362+ return strings . Select ( e => new ACNode { Prefix = prefix , EntryName = e , IsExecutable = executable } ) ;
365363 }
366364
367- public override string ToString ( ) => _name ;
365+ public override string ToString ( ) => Prefix + EntryName ;
368366 }
369367}
0 commit comments