Leaves returns a map of revisions that are leaves in the tree.
()
| 320 | |
| 321 | // Leaves returns a map of revisions that are leaves in the tree. |
| 322 | func (tree RevTree) Leaves() map[string]*RevInfo { |
| 323 | m := make(map[string]*RevInfo) |
| 324 | tree.forEachLeaf(func(info *RevInfo) { |
| 325 | m[info.ID] = info |
| 326 | }) |
| 327 | return m |
| 328 | } |
| 329 | |
| 330 | func (tree RevTree) forEachLeaf(callback func(*RevInfo)) { |
| 331 | isParent := map[string]bool{} |
no test coverage detected