Skip to content

Commit

Permalink
fix: correct lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Feb 12, 2024
1 parent 2b56a3b commit 3bfd426
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pctrie/pctrie.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func New(tr *trie.Trie, compSize int) *PCTrie {
bitmap = append(bitmap, '0')
nhs = append(nhs, make([]string, 0))
}

size++
}

Expand Down
5 changes: 5 additions & 0 deletions trie/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,26 @@ func (t *Trie) Add(route string, nexthop string) {
it.Left = new(Node)
it.Left.prefix = it.prefix + "0"
it.Left.height = it.height + 1

if t.Height < it.Left.height+1 {
t.Height = it.Left.height + 1
}
}

it = it.Left
}

if b == '1' {
if it.Right == nil {
it.Right = new(Node)
it.Right.prefix = it.prefix + "1"
it.Right.height = it.height + 1

if t.Height < it.Right.height+1 {
t.Height = it.Right.height + 1
}
}

it = it.Right
}
}
Expand Down

0 comments on commit 3bfd426

Please sign in to comment.