// GetLen returns probably reused slice of bytes with at least capacity of n
// and exactly len of n.
553780
func (p *Pool) GetLen(n int) []byte {
	return p.Get(n, n)
}
155301
func encodedLen(n int) int {
	const k = aes.BlockSize
	return n/k*k + k + overhead
}
928129
func GetArgsN(line string, n int, options ...GetArgsOption) []string {
	scanner := getScanner(line, options...)
	if n > 0 {
		n = n - 1
	}
	args, rest, _ := scanner.GetTokensN(n)
	if rest != "" {
		args = append(args, rest)
	}
	return args
}
767533
func (po *Po) GetN(str, plural string, n int, vars ...interface{}) string {
	// Sync read
	po.RLock()
	defer po.RUnlock()

	if po.translations != nil {
		if _, ok := po.translations[str]; ok {
			return Printf(po.translations[str].GetN(po.pluralForm(n)), vars...)
		}
	}

	if n == 1 {
		return Printf(str, vars...)
	}
	return Printf(plural, vars...)
}
405493
func LimitLen(b []byte, max ...interface{}) []byte {
	return b[:MinInt(len(b), max...)]
}
800881
func (d *Decoder) VarLen() (val uint32, readBytes uint32, err error) {
	buf := []byte{}
	var lastByte bool
	var n uint32

	for !lastByte {
		b, err := d.ReadByte()
		if err != nil {
			return 0, n, err
		}
		buf = append(buf, b)
		lastByte = (b>>7 == 0x0)
		n++
	}

	val, nUsed := DecodeVarint(buf)
	return val, uint32(nUsed), nil
}
909759
func (mo *Mo) GetN(str, plural string, n int, vars ...interface{}) string {
	// Sync read
	mo.RLock()
	defer mo.RUnlock()

	if mo.translations != nil {
		if _, ok := mo.translations[str]; ok {
			return Printf(mo.translations[str].GetN(mo.pluralForm(n)), vars...)
		}
	}

	if n == 1 {
		return Printf(str, vars...)
	}
	return Printf(plural, vars...)
}
796671
func (q Queue) GetN(n int) (msgs []*Message, err error) {
	return q.GetNWithTimeoutAndWait(n, 0, 0)
}
406615
func getNet(d *Daemon, w http.ResponseWriter, r *http.Request) *HttpErr {
	// get the network name
	vars := mux.Vars(r)
	name := vars["name"]

	network, err := GetNetwork(name)

	if err != nil {
		return &HttpErr{http.StatusNotFound, err.Error()}
	}

	data, err := json.Marshal(network)

	if err != nil {
		return &HttpErr{http.StatusInternalServerError, err.Error()}
	}

	w.Header().Set("Content-type", "application/json; charset=utf-8")
	w.Write(data)

	return nil
}
552375
func (p *ConnPool) IdleLen() int {
	p.connsMu.Lock()
	n := p.idleConnsLen
	p.connsMu.Unlock()
	return n
}
423667
func (c *Consistent) GetN(name string, n int) ([]string, error) {
	c.RLock()
	defer c.RUnlock()

	if len(c.circle) == 0 {
		return nil, ErrEmptyCircle
	}

	if c.count < int64(n) {
		n = int(c.count)
	}

	var (
		key   = c.hashKey(name)
		i     = c.search(key)
		start = i
		res   = make([]string, 0, n)
		elem  = c.circle[c.sortedHashes[i]]
	)

	res = append(res, elem)

	if len(res) == n {
		return res, nil
	}

	for i = start + 1; i != start; i++ {
		if i >= len(c.sortedHashes) {
			i = 0
		}
		elem = c.circle[c.sortedHashes[i]]
		if !sliceContainsMember(res, elem) {
			res = append(res, elem)
		}
		if len(res) == n {
			break
		}
	}

	return res, nil
}
772115
func (c *Client) Get() *bytes.Buffer {
	b := <-c.p.ch
	b.Reset()
	c.sent <- b
	return b
}
535836
func PayloadLen(plen int) NetworkChecker {
	return func(t *testing.T, h []header.Network) {
		t.Helper()

		if l := len(h[0].Payload()); l != plen {
			t.Errorf("Bad payload length, got %v, want %v", l, plen)
		}
	}
}
687786
func matchLen(a, b []byte, max int) int {
	a = a[:max]
	b = b[:len(a)]
	for i, av := range a {
		if b[i] != av {
			return i
		}
	}
	return max
}
898656
func (c *Contract) GetOp(n uint64) OpCode {
	return OpCode(c.GetByte(n))
}
147723
func dataLen(tcp header.TCP) seqnum.Size {
	return seqnum.Size(len(tcp) - int(tcp.DataOffset()))
}
1007932
func (this *Future) GetChan() <-chan *PromiseResult {
	c := make(chan *PromiseResult, 1)
	this.OnComplete(func(v interface{}) {
		c <- this.loadResult()
	}).OnCancel(func() {
		c <- this.loadResult()
	})
	return c
}