Skip to content

♻️ Traverse AST in a single pass during file analysis#109

Merged
savannahostrowski merged 3 commits intomainfrom
single-pass-analyze-tree
Mar 4, 2026
Merged

♻️ Traverse AST in a single pass during file analysis#109
savannahostrowski merged 3 commits intomainfrom
single-pass-analyze-tree

Conversation

@savannahostrowski
Copy link
Member

@savannahostrowski savannahostrowski commented Mar 4, 2026

Closes https://github.com/fastapilabs/cloud/issues/2991

Previously, findNodesByType traversed the full AST for each node type needed — called ~5 times per file in analyzeTree. By refactoring, we now build a complete Map<type, nodes[]> in a single pass, and updated collectStringVariables and collectRecognizedNames to accept the pre-built map rather than re-traversing.

@savannahostrowski savannahostrowski merged commit 7c64223 into main Mar 4, 2026
3 of 4 checks passed
@savannahostrowski savannahostrowski deleted the single-pass-analyze-tree branch March 4, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant