code: func transformChildren(t *Tree) ([]noder.Noder, error) {
  	var err error
  	var e TreeEntry
  
  	// there will be more tree entries than children in the tree,
  	// due to submodules and empty directories, but I think it is still
  	// worth it to pre-allocate the whole array now, even if sometimes
  	// is bigger than needed.
  	ret := make([]noder.Noder, 0, len(t.Entries))
  
  	walker := NewTreeWalker(t, false, nil) // don't recurse
  	// don't defer walker.Close() for efficiency reasons.
  	for {
  		_, e, err = walker.Next()
  		if err == io.EOF {
  			break
  		}
  		if err != nil {
  			walker.Close()
  			return nil, err
  		}
  
  		ret = append(ret, &treeNoder{
  			parent: t,
  			name:   e.Name,
  			mode:   e.Mode,
  			hash:   e.Hash,
  		})
  	}
  	walker.Close()
  
  	return ret, nil
  }
docs: // Returns the children of a tree as treenoders.
  // Efficiency is key here.