Skip to content

Commit

Permalink
Improve Node.GetChildKeys()
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyCushnie committed Apr 26, 2024
1 parent 361c087 commit ea5920a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions SUCC/Parsing Logic/Nodes/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,13 @@ public void CapChildCount(int count)
}
}

public string[] GetChildKeys()
public IEnumerable<string> GetChildKeys()
{
var keys = new string[ChildNodes.Count];
if (ChildNodeType != NodeChildrenType.Key)
yield break;

for (int i = 0; i < ChildNodes.Count; i++)
keys[i] = (ChildNodes[i] as KeyNode).Key;

return keys;
foreach (var node in ChildNodes)
yield return (node as KeyNode).Key;
}


Expand Down

0 comments on commit ea5920a

Please sign in to comment.