// Line dispatches a parameter fn into multiple goroutines by splitting the parameter length
// by the number of available CPUs and assigning the length parts into each fn.
161158
func Line(length int, fn func(start, end int)) {
	procs := runtime.GOMAXPROCS(0)
	counter := length
	partSize := length / procs
	if procs <= 1 || partSize <= procs {
		fn(0, length)
	} else {
		var wg sync.WaitGroup
		for counter > 0 {
			start := counter - partSize
			end := counter
			if start < 0 {
				start = 0
			}
			counter -= partSize
			wg.Add(1)
			go func() {
				defer wg.Done()
				fn(start, end)
			}()
		}

		wg.Wait()
	}
}
559200
func (mp *MacroProcessor) ProcessLines(lines []*Line, readMacros bool) []*Line {
	result := make([]*Line, 0, len(lines))
	for _, line := range lines {
		if line.Pattern != nil {
			resultLine := Line{
				Pattern: line.Pattern,
				Attrs:   make([]*Attr, 0, len(line.Attrs)),
			}
			for _, attr := range line.Attrs {
				macros := mp.macros[attr.K]
				if attr.V == "true" && macros != nil {
					resultLine.Attrs = append(
						resultLine.Attrs,
						macros...,
					)
				}

				// Git copies through aliases as well as
				// expanding them.
				resultLine.Attrs = append(
					resultLine.Attrs,
					attr,
				)
			}
			result = append(result, &resultLine)
		} else if readMacros {
			mp.macros[line.Macro] = line.Attrs
		}
	}
	return result
}
1344767
func (v *View) breakLine(x, y int) error {
	v.tainted = true

	x, y, err := v.realPosition(x, y)
	if err != nil {
		return err
	}

	if y < 0 || y >= len(v.lines) {
		return errors.New("invalid point")
	}

	var left, right []cell
	if x < len(v.lines[y]) { // break line
		left = make([]cell, len(v.lines[y][:x]))
		copy(left, v.lines[y][:x])
		right = make([]cell, len(v.lines[y][x:]))
		copy(right, v.lines[y][x:])
	} else { // new empty line
		left = v.lines[y]
	}

	lines := make([][]cell, len(v.lines)+1)
	lines[y] = left
	lines[y+1] = right
	copy(lines, v.lines[:y])
	copy(lines[y+2:], v.lines[y+1:])
	v.lines = lines
	return nil
}
270499
func (f Files) Lines(path string) []string {
	if f == nil || f[path] == nil {
		return []string{}
	}

	return strings.Split(string(f[path]), "\n")
}
209667
func NewLine(args ...interface{}) Composer {
	m := &lineMessenger{}
	for _, arg := range args {
		if arg != nil {
			m.lines = append(m.lines, arg)
		}
	}

	return m
}
853981
func writeLine(bf *bytes.Buffer, indent int, strs ...string) {
	writeLineFeed(bf)
	writeIndent(bf, indent)
	for _, s := range strs {
		bf.WriteString(s)
	}
}
468054
func (b *buffer) deleteLine() error {
	lines, err := b.end()
	if err != nil {
		return err
	}

	for lines > 0 {
		if _, err = term.Output.Write(DelLine_cursorUp); err != nil {
			return outputError(err.Error())
		}
		lines--
	}
	return nil
}
1286629
func Lines(l int) Option {
	return func(s *Scroller) error {
		if l < 0 {
			return errors.New(ErrNegativeLines, errorMessages, l)
		}
		s.lines = l
		return nil
	}
}
1218489
func httpParseRequestLine(line []byte) (req httpRequestLine, err error) {
	var proto []byte
	req.method, req.uri, proto = bsplit3(line, ' ')

	var ok bool
	req.major, req.minor, ok = httpParseVersion(proto)
	if !ok {
		err = ErrMalformedRequest
		return
	}

	return
}
833131
func (g *Group) WriteLine(line string) error {
	g.mtx.Lock()
	defer g.mtx.Unlock()
	_, err := g.headBuf.Write([]byte(line + "\n"))
	return err
}
1352456
func (d *ArgErrDetail) Lines() []string {
	lines := make([]string, 2)
	lines[0] = fmt.Sprint("have: ", formatArgs(d.Have))
	lines[1] = fmt.Sprint("want: ", formatArgs(d.Want))
	return lines
}
503526
func Line(prompt string) (string, error) { // char *linenoise(const char *prompt);
	promptCString := C.CString(prompt)
	resultCString := C.linenoise(promptCString)
	C.free(unsafe.Pointer(promptCString))
	defer C.free(unsafe.Pointer(resultCString))

	if resultCString == nil {
		return "", KillSignalError
	}

	result := C.GoString(resultCString)

	return result, nil
}
376892
func (f *Fpdf) Line(x1, y1, x2, y2 float64) {
	f.outf("%.2f %.2f m %.2f %.2f l S", x1*f.k, (f.h-y1)*f.k, x2*f.k, (f.h-y2)*f.k)
}
548510
func (builder *Builder) NextLine(n uint) *Builder {
	return builder.With(NextLine(n))
}
1033144
func newLine(no int, s string) *line {
	return &line{
		no:     no,
		s:      s,
		indent: indent(s),
	}
}
284652
func (u *UI) Line(format string, a ...interface{}) {
	u.LineIndent(0, format, a...)
}
622628
func ForEachLine(json string, iterator func(line Result) bool) {
	var res Result
	var i int
	for {
		i, res, _ = parseAny(json, i, true)
		if !res.Exists() {
			break
		}
		if !iterator(res) {
			return
		}
	}
}