Skip to content

Commit

Permalink
Cache parameters list
Browse files Browse the repository at this point in the history
  • Loading branch information
slozier committed Dec 11, 2024
1 parent 517c548 commit 9a6cede
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Src/IronPython/Compiler/Ast/FunctionDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ internal override MSAst.Expression LocalContext {

public IList<Parameter> Parameters => _parameters;

internal override string[] ParameterNames => ArrayUtils.ConvertAll(_parameters, val => val.Name);
private string[] _parameterNames = null;

internal override string[] ParameterNames => _parameterNames ??= ArrayUtils.ConvertAll(_parameters, val => val.Name);

internal override int ArgCount {
get {
Expand Down

0 comments on commit 9a6cede

Please sign in to comment.