Skip to content

Commit

Permalink
node order clean fix (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
s0rg authored Mar 22, 2024
1 parent de854de commit 3a1a16d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ linters:
fast: false

output:
format: 'colored-line-number'
print-issued-lines: true
print-linter-name: true
3 changes: 3 additions & 0 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func (n *node[T]) DelChild(r rune) {
if c, ok := n.childs[r]; ok {
delete(n.childs, r)

idx := slices.Index(n.order, r)
n.order = slices.Delete(n.order, idx, idx+1)

c.parent = nil
}
}
Expand Down

0 comments on commit 3a1a16d

Please sign in to comment.