Commit
+2 -6 +/-1 browse
1 | diff --git a/pkg/hierarchy/tree.go b/pkg/hierarchy/tree.go |
2 | index 0c02123..68978f8 100644 |
3 | --- a/pkg/hierarchy/tree.go |
4 | +++ b/pkg/hierarchy/tree.go |
5 | @@ -18,10 +18,6 @@ type Tree struct { |
6 | Notes []*Note |
7 | } |
8 | |
9 | - func (t Tree) next(value bool, depth []bool) (result []bool) { |
10 | - return append(append(result, depth...), value) |
11 | - } |
12 | - |
13 | func (t Tree) fill(w io.Writer, depth []bool) { |
14 | for i := 0; i < len(depth); i++ { |
15 | if depth[i] { |
16 | @@ -46,8 +42,8 @@ func (t Tree) write(notes []*Note, depth []bool, buf *bytes.Buffer) { |
17 | buf.WriteString(np.Name() + "\n") |
18 | } |
19 | if len(note.Descendants) > 0 { |
20 | - t.write(note.Descendants, t.next(len(note.Descendants) > |
21 | - 0 && !last, depth), buf) |
22 | + t.write(note.Descendants, |
23 | + append(depth, len(note.Descendants) > 0 && !last), buf) |
24 | } |
25 | } |
26 | } |