File tree Expand file tree Collapse file tree
src/core/IronPython/Compiler/Ast Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -407,10 +407,10 @@ public static string[] FindNames(FunctionDefinition function) {
407407
408408 var finder = new SelfNameFinder ( function , parameters [ 0 ] ) ;
409409 function . Body . Walk ( finder ) ;
410- return ArrayUtils . ToArray ( finder . _names . Keys ) ;
410+ return [ .. finder . _names ] ;
411411 }
412412
413- private readonly Dictionary < string , bool > _names = new Dictionary < string , bool > ( StringComparer . Ordinal ) ;
413+ private readonly HashSet < string > _names = new ( StringComparer . Ordinal ) ;
414414
415415 private bool IsSelfReference ( Expression expr ) {
416416 return expr is NameExpression ne
@@ -426,7 +426,7 @@ public override bool Walk(AssignmentStatement node) {
426426 foreach ( Expression lhs in node . Left ) {
427427 if ( lhs is MemberExpression me ) {
428428 if ( IsSelfReference ( me . Target ) ) {
429- _names [ me . Name ] = true ;
429+ _names . Add ( me . Name ) ;
430430 }
431431 }
432432 }
You can’t perform that action at this time.
0 commit comments