// FindFirst implements the StringTree interface.
424035
func (t *stringTree) FindFirst(f func(v string) (bool, error)) StringChanger {
	n, err := t.container.root.findFirst(func(fn *node) (bool, error) {
		return f(fn.content.value().(string))
	})
	return &stringChanger{n, err}
}
233666
func (l *List) First() *ListElement {
	if l == nil { // not initialized yet?
		return nil
	}

	return l.head.Next()
}
967667
func ReadFirstLine(s string, isIgnoreLeadingEmptyLines bool) string {
	scanner := bufio.NewScanner(strings.NewReader(s))
	firstLine := ""
	for scanner.Scan() {
		firstLine = scanner.Text()
		if !isIgnoreLeadingEmptyLines || firstLine != "" {
			break
		}
	}
	return firstLine
}
278948
func (l SecondaryLayer) SeekFirst() (e *SecondaryEnumerator, err error) {
	l.lock.Lock()
	e, err = l.store.SeekFirst()
	l.lock.Unlock()
	return
}
131616
func FindEach(top *Node, expr string, cb func(int, *Node)) {
	for i, n := range Find(top, expr) {
		cb(i, n)
	}
}
573499
func (t Types) GetFirstBySuffix(suffix string) (Type, bool) {
	for _, tt := range t {
		if match := tt.matchSuffix(suffix); match != "" {
			tt.fileSuffix = match
			return tt, true
		}
	}
	return Type{}, false
}
1181736
func (c *index) SeekFirst(r kv.Retriever) (iter table.IndexIterator, err error) {
	upperBound := c.prefix.PrefixNext()
	it, err := r.Iter(c.prefix, upperBound)
	if err != nil {
		return nil, err
	}
	return &indexIter{it: it, idx: c, prefix: c.prefix}, nil
}
1251093
func (t *tree) First() (k uint64, v *roaring.Container) {
	if q := t.first; q != nil {
		q := &q.d[0]
		k, v = q.k, q.v
	}
	return k, v
}
1174888
func FindFirstMatchingFile(glob string) (string, error) {
	matches, err := filepath.Glob(glob)
	if err != nil {
		return "", err
	}
	if len(matches) >= 1 {
		return matches[0], nil
	}
	return "", nil
}
1134076
func (p *propInterfaces) GetFirstInterface() *Interface {
	if len(p.Interfaces) == 0 {
		return nil
	}
	return &p.Interfaces[0]
}
309345
func lowerFirst(s string) string {
	if s == "" {
		return ""
	}
	r, n := utf8.DecodeRuneInString(s)
	return string(unicode.ToLower(r)) + s[n:]
}
505066
func (t *keyValueTree) FindFirst(f func(k string, v interface{}) (bool, error)) KeyValueChanger {
	n, err := t.container.root.findFirst(func(fn *node) (bool, error) {
		return f(fn.content.key().(string), fn.content.value())
	})
	return &keyValueChanger{n, err}
}
267266
func (c *chunkedSeq) ChunkedFirst() iseq.Chunk {
	return newArrayChunk2(c.node, c.offset)
}
644705
func (t *stringTree) FindAll(f func(v string) (bool, error)) []StringChanger {
	ns, err := t.container.root.findAll(func(fn *node) (bool, error) {
		return f(fn.content.value().(string))
	})
	if err != nil {
		return []StringChanger{&stringChanger{nil, err}}
	}
	var cs []StringChanger
	for _, n := range ns {
		cs = append(cs, &stringChanger{n, nil})
	}
	return cs
}
165202
func Find(source string, targets []string) []string {
	return find(source, targets, noop)
}
391350
func MaxFirstChars(inStr string, maxCharCount int) string {
	return genericTrim(inStr, maxCharCount, false, false)
}
845828
func (d *Document) FindStartOfPreviousWord() int {
	x := d.TextBeforeCursor()
	i := strings.LastIndexByte(x, ' ')
	if i != -1 {
		return i + 1
	}
	return 0
}