// Front returns the first element of list l or nil
164716
func (l *list) Front() *element {
	if l.len == 0 {
		return nil
	}
	return l.root.next
}
376674
func (e *FSTEnum) pushFirst() (err error) {
	arc := e.arcs[e.upto]
	assert(arc != nil)

	for {
		e.output[e.upto] = e.fst.outputs.Add(e.output[e.upto-1], arc.Output)
		if arc.Label == FST_END_LABEL {
			// final node
			break
		}
		// fmt.Printf("  pushFirst label=%c upto=%v output=%v\n",
		// 	rune(arc.Label), e.upto, e.fst.outputs.outputToString(e.output[e.upto]))
		e.spi.setCurrentLabel(arc.Label)
		e.incr()

		nextArc := e.Arc(e.upto)
		if _, err = e.fst.readFirstTargetArc(arc, nextArc, e.fstReader); err != nil {
			return
		}
		arc = nextArc
	}
	return nil
}
1111275
func (l *ItemList) PushFront(v Item) *ItemElement {
	l.lazyInit()
	return l.insertValue(v, &l.root)
}
316481
func (l *ItemList) MoveToFront(e *ItemElement) {
	if e.list != l || l.root.next == e {
		return
	}
	// see comment in List.Remove about initialization of l
	l.insert(l.remove(e), &l.root)
}
398589
func (l *List) PushFront(e Element) {
	ElementMapper{}.linkerFor(e).SetNext(l.head)
	ElementMapper{}.linkerFor(e).SetPrev(nil)

	if l.head != nil {
		ElementMapper{}.linkerFor(l.head).SetPrev(e)
	} else {
		l.tail = e
	}

	l.head = e
}
788896
func (b *Driver) Forward(val int) error {
	b.pcmdMutex.Lock()
	defer b.pcmdMutex.Unlock()

	b.Pcmd.Flag = 1
	b.Pcmd.Pitch = validatePitch(val)
	return nil
}
348127
func (l *waiterList) PushFront(e *Entry) {
	waiterElementMapper{}.linkerFor(e).SetNext(l.head)
	waiterElementMapper{}.linkerFor(e).SetPrev(nil)

	if l.head != nil {
		waiterElementMapper{}.linkerFor(l.head).SetPrev(e)
	} else {
		l.tail = e
	}

	l.head = e
}
649932
func (db *DB) LTrimFront(key []byte, trimSize int32) (int32, error) {
	return db.ltrim(key, trimSize, listHeadSeq)
}
643720
func (g *Group) GetFirstElem(operand Operand) *list.Element {
	if operand == OperandAny {
		return g.Equivalents.Front()
	}
	return g.FirstExpr[operand]
}
689437
func (all *assetLruList) MoveToFront(alle *assetLruListElement) {
	if alle.list != all || all.root.next == alle {
		return
	}
	// see comment in assetLruList.Remove about initialization of l
	all.insert(all.remove(alle), &all.root)
}
1110155
func (s *RedisQueueStore) GetFront(key string, length int) (res []string, err error) {
	if !strings.HasPrefix(key, s.prefix) {
		key = s.prefix + key
	}
	res, err = s.client.LRange(key, 0, int64(length-1)).Result()
	if err == redis.Nil {
		return res, nil
	}
	return res, err
}
1190360
func (c *Cursor) Forward(n int) {
	fmt.Fprintf(c.Out, "\x1b[%dC", n)
}
752885
func (m *txSortedMap) Forward(threshold uint64) types.Transactions {
	var removed types.Transactions

	// Pop off heap items until the threshold is reached
	for m.index.Len() > 0 && (*m.index)[0] < threshold {
		nonce := heap.Pop(m.index).(uint64)
		removed = append(removed, m.items[nonce])
		delete(m.items, nonce)
	}
	// If we had a cached order, shift the front
	if m.cache != nil {
		m.cache = m.cache[len(removed):]
	}
	return removed
}
471947
func (p *pipelineChannel) PushFront(h HandlerTempl) {
	Handlers := make([]HandlerTempl, len(p.Handlers)+1)
	Handlers[0] = h
	copy(Handlers[1:], p.Handlers)
	p.Handlers = Handlers
}
578600
func Read(data []byte, frontmatter interface{}) (content []byte, err error) {
	r := bytes.NewBuffer(data)

	// eat away starting whitespace
	var ch rune = ' '
	for unicode.IsSpace(ch) {
		ch, _, err = r.ReadRune()
		if err != nil {
			// file is just whitespace
			return []byte{}, nil
		}
	}
	r.UnreadRune()

	// check if first line is ---
	line, err := r.ReadString('\n')
	if err != nil && err != io.EOF {
		return nil, err
	}

	if strings.TrimSpace(line) != "---" {
		// no front matter, just content
		return data, nil
	}

	matterStart := len(data) - r.Len()
	matterEnd := matterStart

	for {
		line, err = r.ReadString('\n')
		if err != nil {
			if err == io.EOF {
				return data, nil
			}
			return nil, err
		}

		if strings.TrimSpace(line) == "---" {
			matterEnd = len(data) - r.Len() - len(line)
			content = data[matterEnd+len(line):]
			break
		}
	}

	_, err = toml.Decode(string(data[matterStart:matterEnd]), frontmatter)
	if err != nil {
		return nil, err
	}
	err = nil
	return
}
783011
func (l *PacketList) Front() *PacketElement {
	if l.len == 0 {
		return nil
	}
	return l.root.next
}
236978
func (l *PacketList) PushFront(v Packet) *PacketElement {
	l.lazyInit()
	return l.insertValue(v, &l.root)
}