// First element
16926
func (c *PrefixCursor) First() ([]byte, []byte) {
	var k, v []byte

	for k, v = c.C.First(); k != nil && !bytes.HasPrefix(k, c.Prefix); k, v = c.C.Next() {
	}

	if k == nil {
		return nil, nil
	}

	if c.Reverse {
		kc, vc := k, v
		for ; kc != nil && bytes.HasPrefix(kc, c.Prefix); kc, vc = c.C.Next() {
			k, v = kc, vc
		}
		if kc != nil {
			k, v = c.C.Prev()
		}
	}

	return k, v
}
474810
func FirstError(errs ...error) error {
	for i := range errs {
		if errs[i] != nil {
			return errs[i]
		}
	}
	return nil
}
794608
func (t *Tree) First() (k []byte, v []byte) {
	if q := t.first; q != nil {
		q := &q.d[0]
		k, v = q.k, q.v
	}
	return
}
827911
func (n NameIDFormat) Element() *etree.Element {
	el := etree.NewElement("")
	el.SetText(string(n))
	return el
}
998777
func (txn *Txn) First(table, index string, args ...interface{}) (interface{}, error) {
	_, val, err := txn.FirstWatch(table, index, args...)
	return val, err
}
1179643
func (list *List) FirstN(n int) []string {
	if n < 1 || n >= list.length {
		return emptySlice()
	}
	return list.Slice(0, n-1)
}
669120
func (e *element) Prev() *element {
	if p := e.prev; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
727363
func (mvl *MetricsList) First() *MetricValue {
	if len(mvl.data) > 0 {
		mvl.Sort()
		return mvl.data[0]
	}
	return nil
}
409216
func (c *cursor) First() (key, value []byte) {
	return (*bbolt.Cursor)(c).First()
}
400730
func (q *LinkedBlockingDeque) AddFirst(e interface{}) error {
	if e == nil {
		return errors.New("e is nil")
	}
	if !q.OfferFirst(e) {
		return errors.New("Deque full")
	}
	return nil
}
5881
func (c *Cursor) First() *Position {
	return &Position{IP: c.ps[0].IP, Prefix: c.ps[0]}
}
1363716
func (c *Cursor) First() ([]byte, []byte) {
	k, v := c.cursor.First()
	if len(k) == 0 && len(v) == 0 {
		return nil, nil
	}
	return k, v
}
920954
func (r *QueryResults) First(t *testing.T) *QueryResult {
	r.HasTableCount(t, 1)
	for _, result := range r.Results {
		return &QueryResult{t: t, q: result}
	}
	return nil
}
837692
func (s *StatusCode) Element() *etree.Element {
	el := etree.NewElement("samlp:StatusCode")
	el.CreateAttr("Value", s.Value)
	if s.StatusCode != nil {
		el.AddChild(s.StatusCode.Element())
	}
	return el
}
1366232
func (f *Frame) First() (noder.Noder, bool) {
	if f.Len() == 0 {
		return nil, false
	}

	top := f.Len() - 1

	return f.stack[top], true
}
705446
func First(i interface{}) (interface{}, error) {
	t := reflect.TypeOf(i)
	v := reflect.ValueOf(i)

	switch t.Kind() {
	case reflect.Array, reflect.Slice:
	default:
		return nil, fmt.Errorf("value is nither Slice nor Array")
	}

	if v.Len() == 0 {
		return nil, fmt.Errorf("empty array")
	}

	return v.Index(0).Interface(), nil
}
145361
func (h *HTML) firstChild() jsObject {
	if h == nil || h.node == nil {
		return nil
	}
	return h.node.Get("firstChild")
}