File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff 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
1216func 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
2121func (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)
101102func 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
You can’t perform that action at this time.
0 commit comments