test tree foreach

This commit is contained in:
Bel LaPointe
2022-02-16 08:05:14 -07:00
parent 63caf9ed03
commit a7c8a0d481
5 changed files with 39 additions and 16 deletions

View File

@@ -26,7 +26,7 @@ func (branch Branch) forEach(preid ID, foo func(ID, Leaf) error) error {
return err
}
for id, child := range branch.Branches {
if err := child.forEach(preid.Push(string(id)), foo); err != nil {
if err := child.forEach(id, foo); err != nil {
return err
}
}