// Peek is supposed to be called by heap.Peek only.
962831
func (h *heapData) Peek() interface{} {
	if len(h.queue) > 0 {
		return h.items[h.queue[0]].obj
	}
	return nil
}
888221
func (l *Lexer) Peek() rune {
	r := l.Next()
	l.backup()
	return r
}
861886
func (h *vaultClientHeap) Peek() *vaultClientHeapEntry {
	if len(h.heap) == 0 {
		return nil
	}

	return h.heap[0]
}
1085928
func (v *PVector) Peek() interface{} {
	if v.cnt > 0 {
		return v.Nth(v.cnt - 1)
	}
	return nil
}
995751
func (l *Scanner) Peek2() (a, b byte) {
	if l.pos == len(l.data) {
		return 0, 0
	}
	if l.pos+1 == len(l.data) {
		return l.data[l.pos], 0
	}
	return l.data[l.pos], l.data[l.pos+1]
}
341141
func (pq *PrefixQueue) Peek(prefix []byte) (*Item, error) {
	pq.RLock()
	defer pq.RUnlock()

	// Check if queue is closed.
	if !pq.isOpen {
		return nil, ErrDBClosed
	}

	// Get the queue for this prefix.
	q, err := pq.getQueue(prefix)
	if err != nil {
		return nil, err
	}

	return pq.getItemByPrefixID(prefix, q.Head+1)
}
529012
func (r *Ring) Peek() interface{} {
	r.Lock()
	defer r.Unlock()

	r.checkInit()
	if r.head == -1 {
		return nil
	}
	return r.get(r.tail)
}
1339583
func (q *BytesQueue) peekCheckErr(index int) error {

	if q.count == 0 {
		return errEmptyQueue
	}

	if index <= 0 {
		return errInvalidIndex
	}

	if index+headerEntrySize >= len(q.array) {
		return errIndexOutOfBounds
	}
	return nil
}
877874
func (s *scanner) peek() rune {
	r := s.read()
	s.unread()
	return r
}
53742
func (t *Tree) peek() token {
	tok := t.next()
	t.backup()

	return tok
}
877087
func (c *TwoQueueCache) Peek(key interface{}) (value interface{}, ok bool) {
	c.lock.RLock()
	defer c.lock.RUnlock()
	if val, ok := c.frequent.Peek(key); ok {
		return val, ok
	}
	return c.recent.Peek(key)
}
700039
func (q *ListQueue) Peek() (interface{}, error) {
	if q.IsEmpty() {
		return nil, errors.New("unable to peek element, queue is empty")
	}
	return q.first.item, nil
}
1064225
func (s *FIFO) Peek() (T, bool) {
	if s.front == nil {
		return nil, false
	}
	return s.front.v, true
}
1297143
func (s *Scanner) peek() rune {
	peek, _, err := s.buf.ReadRune()
	if err != nil {
		return eof
	}

	s.buf.UnreadRune()
	return peek
}
763180
func (this *Beanstalkd) Peek(id uint64) (*Job, error) {
	e := this.send("peek %d\r\n", id)
	if e != nil {
		return nil, e
	}
	return this.handlePeekReply()
}
798509
func (l *LLk) Peek(k int) (*lexer.Token, error) {
	if k > l.k {
		return nil, fmt.Errorf("grammar.LLk: cannot look ahead %v beyond defined %v", k, l.k)
	}
	if k <= 0 {
		return nil, fmt.Errorf("grammar.LLk: invalid look ahead value %v", k)
	}
	return &l.tkns[k], nil
}
1334887
func (c *LRU) Peek(base int64) (exist bool, next int64) {
	c.mu.RLock()
	defer c.mu.RUnlock()

	n, exist := c.table[base]
	if !exist {
		return false, -1
	}
	next = n.b.NextBase()
	return exist, next
}