1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-07-04 18:52:50 +00:00

oops, missed a spot before

run gofmt, remove an unused bit
This commit is contained in:
Elias Bomberger 2021-10-17 14:30:19 -04:00
parent 835529947b
commit e4cd5e4a5f

View File

@ -96,7 +96,7 @@ func Tree(hyphaName string) (siblingsHTML, childrenHTML, prev, next string) {
wg.Done() wg.Done()
}() }()
go func() { go func() {
children = figureOutChildren(hyphaName, true).children children = figureOutChildren(hyphaName).children
wg.Done() wg.Done()
}() }()
wg.Wait() wg.Wait()
@ -124,10 +124,10 @@ type child struct {
children []child children []child
} }
func figureOutChildren(hyphaName string, exists bool) child { func figureOutChildren(hyphaName string) child {
var ( var (
descPrefix = hyphaName + "/" descPrefix = hyphaName + "/"
child = child{hyphaName, true, make([]child, 0)} child = child{hyphaName, true, make([]child, 0)}
) )
for desc := range hyphae.YieldExistingHyphae() { for desc := range hyphae.YieldExistingHyphae() {
@ -153,9 +153,9 @@ func addHyphaToChild(hyphaName, subPath string, child *child) {
} else { } else {
var ( var (
firstSlash = strings.IndexRune(subPath, '/') firstSlash = strings.IndexRune(subPath, '/')
firstDir = subPath[:firstSlash] firstDir = subPath[:firstSlash]
restOfPath = subPath[firstSlash + 1:] restOfPath = subPath[firstSlash+1:]
subchild = findOrCreateSubchild(firstDir, child) subchild = findOrCreateSubchild(firstDir, child)
) )
addHyphaToChild(hyphaName, restOfPath, subchild) addHyphaToChild(hyphaName, restOfPath, subchild)
} }
@ -172,7 +172,7 @@ func findOrCreateSubchild(name string, baseChild *child) *child {
} }
} }
baseChild.children = append(baseChild.children, child{fullName, false, make([]child, 0)}) baseChild.children = append(baseChild.children, child{fullName, false, make([]child, 0)})
return &baseChild.children[len(baseChild.children) - 1] return &baseChild.children[len(baseChild.children)-1]
} }
type sibling struct { type sibling struct {