(path string, value int)
| 18 | } |
| 19 | |
| 20 | func (FileSystem) CreatePath(path string, value int) (ans bool) { |
| 21 | sp := strings.Split(path[1:], "/") |
| 22 | n := len(sp) |
| 23 | o := rt |
| 24 | for _, s := range sp[:n-1] { |
| 25 | if o.ch[s] == nil { |
| 26 | return |
| 27 | } |
| 28 | o = o.ch[s] |
| 29 | } |
| 30 | end := sp[n-1] |
| 31 | if o.ch[end] != nil { |
| 32 | return |
| 33 | } |
| 34 | o.ch[end] = &node{map[string]*node{}, value} |
| 35 | return true |
| 36 | } |
| 37 | |
| 38 | func (FileSystem) Get(path string) (ans int) { |
| 39 | o := rt |
nothing calls this directly
no outgoing calls
no test coverage detected