Skip to content

Commit 92d8de9

Browse files
authored
opt(export): remember visited to avoid redundant computation (#46)
1 parent a565a5c commit 92d8de9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lang/collect/export.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ func (c *Collector) Export(ctx context.Context) (*uniast.Repository, error) {
7575
c.filterLocalSymbols()
7676

7777
// export symbols
78+
visited := make(map[*lsp.DocumentSymbol]*uniast.Identity)
7879
for _, symbol := range c.syms {
79-
visited := make(map[*lsp.DocumentSymbol]*uniast.Identity)
8080
_, _ = c.exportSymbol(&repo, symbol, "", visited)
8181
}
8282

0 commit comments

Comments
 (0)