Avoid duplication at the tip of the tree.
This commit is contained in:
parent
0bd99eaff7
commit
67e51c9f1b
1 changed files with 7 additions and 5 deletions
|
@ -257,12 +257,14 @@ func (i *Intermediate) String() string {
|
|||
|
||||
childLines := strings.Split(lines[treeSize-1], "\n")
|
||||
lenChildLines := len(childLines)
|
||||
out += fmt.Sprintf("%s%s%s\n", NodePad, NodeL, childLines[0])
|
||||
for a := 1; a < lenChildLines-2; a++ {
|
||||
out += fmt.Sprintf("%s%s%s\n", NodePad, NodePad, childLines[a])
|
||||
}
|
||||
if lenChildLines > 0 {
|
||||
if lenChildLines > 1 {
|
||||
out += fmt.Sprintf("%s%s%s\n", NodePad, NodeL, childLines[0])
|
||||
for a := 1; a < lenChildLines-2; a++ {
|
||||
out += fmt.Sprintf("%s%s%s\n", NodePad, NodePad, childLines[a])
|
||||
}
|
||||
out += fmt.Sprintf("%s%s%s", NodePad, NodePad, childLines[lenChildLines-1])
|
||||
} else {
|
||||
out += fmt.Sprintf("%s%s%s", NodePad, NodeL, childLines[0])
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue