mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
AstNode.Children and the visitors' VisitChildren walked children via FirstChild/NextSibling, an O(slots) index rescan per step. The generator now emits GetChildNodes, which materializes the children in slot order in one pass (O(children)); Children and VisitChildren iterate that. The snapshot makes the walk tolerant of the visitor removing or replacing the current child (the mutation pattern the old capture-next loop supported) without re-feeding the loop. Assisted-by: Claude:claude-opus-4-8:Claude Codepull/3807/head
3 changed files with 34 additions and 28 deletions
Loading…
Reference in new issue