Skip to content

Commit e79e841

Browse files
committed
fix CR comments
1 parent 279815d commit e79e841

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pkg/ingressCache/pathTrie.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import (
88
"github.com/nuclio/errors"
99
)
1010

11+
type PathTree struct {
12+
t *trie.PathTrie
13+
}
14+
1115
// NewPathTree creates a new PathTree instance
1216
func NewPathTree() *PathTree {
1317
return &PathTree{trie.NewPathTrie()}
1418
}
1519

16-
type PathTree struct {
17-
t *trie.PathTrie
18-
}
19-
2020
// SetFunctionName sets a function for a given path. If the path does not exist, it creates it
2121
func (p *PathTree) SetFunctionName(path string, function string) error {
2222
if path == "" {
@@ -27,7 +27,7 @@ func (p *PathTree) SetFunctionName(path string, function string) error {
2727
return errors.New("function is empty")
2828
}
2929

30-
// get the exact path value in order to avoid creating a new path if it does not exist
30+
// get the exact path value in order to avoid creating a new path if it already exists
3131
pathValue := p.t.Get(path)
3232
if pathValue == nil {
3333
p.t.Put(path, []string{function})
@@ -98,6 +98,7 @@ func (p *PathTree) GetFunctionName(path string) ([]string, error) {
9898
return output, nil
9999
}
100100

101+
// TODO - will be removed once moving into efficient pathFunctionNames implementation (i.e. not using slices)
101102
func excludeElemFromSlice(slice []string, elem string) []string {
102103
// 'j' is the "write" index. It tracks where the next element to keep should be placed.
103104
j := 0

0 commit comments

Comments
 (0)