Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 424e767

Browse filesBrowse files
committed
Clear node builder links when done
1 parent 12cbd18 commit 424e767
Copy full SHA for 424e767

File tree

Expand file treeCollapse file tree

2 files changed

+9
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-4
lines changed

‎internal/checker/nodebuilder.go

Copy file name to clipboardExpand all lines: internal/checker/nodebuilder.go
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ func (b *NodeBuilder) popContext() {
4343
stackSize := len(b.ctxStack)
4444
if stackSize == 0 {
4545
b.impl.ctx = nil
46+
b.impl.links.Clear()
47+
b.impl.symbolLinks.Clear()
4648
} else {
4749
b.impl.ctx = b.ctxStack[stackSize-1]
4850
b.ctxStack = b.ctxStack[:stackSize-1]
@@ -169,7 +171,3 @@ func NewNodeBuilder(ch *Checker, e *printer.EmitContext) *NodeBuilder {
169171
impl := newNodeBuilderImpl(ch, e)
170172
return &NodeBuilder{impl: impl, ctxStack: make([]*NodeBuilderContext, 0, 1), host: ch.program}
171173
}
172-
173-
func (c *Checker) GetDiagnosticNodeBuilder() *NodeBuilder {
174-
return c.nodeBuilder
175-
}

‎internal/core/linkstore.go

Copy file name to clipboardExpand all lines: internal/core/linkstore.go
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,10 @@ func (s *LinkStore[K, V]) Has(key K) bool {
2828
func (s *LinkStore[K, V]) TryGet(key K) *V {
2929
return s.entries[key]
3030
}
31+
32+
func (s *LinkStore[K, V]) Clear() {
33+
clear(s.entries)
34+
*s = LinkStore[K, V]{
35+
entries: s.entries,
36+
}
37+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.