removed unused func
This commit is contained in:
parent
43d72938b1
commit
2045792354
32
tree.go
32
tree.go
@ -4,38 +4,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
func get_children(header_index int, headings []heading) []heading {
|
|
||||||
var children []heading
|
|
||||||
|
|
||||||
parent_level := get_heading_level(headings[header_index].text)
|
|
||||||
|
|
||||||
next_level := get_heading_level(headings[header_index+1].text)
|
|
||||||
|
|
||||||
child_level := 0
|
|
||||||
|
|
||||||
if next_level <= parent_level {
|
|
||||||
return nil
|
|
||||||
} else {
|
|
||||||
child_level = next_level
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_level := 0
|
|
||||||
|
|
||||||
for i := (header_index + 1); i < len(headings); i++ {
|
|
||||||
cur_level = get_heading_level(headings[i].text)
|
|
||||||
|
|
||||||
if cur_level == child_level {
|
|
||||||
children = append(children, headings[i])
|
|
||||||
}
|
|
||||||
|
|
||||||
if cur_level < child_level {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return children
|
|
||||||
}
|
|
||||||
|
|
||||||
func get_root_children(headings []heading) []int {
|
func get_root_children(headings []heading) []int {
|
||||||
var root_children []int
|
var root_children []int
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user