ref: 3ce59c3248dec0eb0f918c42f37f53bc2ac20425
dir: /object/tree/lookup.go/
package tree
// Entry looks up a tree entry by name.
//
// The returned pointer refers to storage within tree.Entries and must not be
// retained across InsertEntry or RemoveEntry calls.
func (tree *Tree) Entry(name []byte) *TreeEntry {
if len(tree.Entries) == 0 {
return nil
}
index, ok := tree.entryIndex(name)
if !ok {
return nil
}
return &tree.Entries[index]
}