// Trim frames in the device's history
978944
func (s *RedisFrameHistory) Trim() error {
	return s.store.Trim(s.key(), FramesHistorySize)
}
335225
func trimSrcPath(absPath, srcPath string) string {
	relPath, err := filepath.Rel(srcPath, absPath)
	if err != nil {
		er(err)
	}
	return relPath
}
903356
func (s *BrocadeVCSService) NewDeleteBrocadeVcsDeviceParams(vcsdeviceid string) *DeleteBrocadeVcsDeviceParams {
	p := &DeleteBrocadeVcsDeviceParams{}
	p.p = make(map[string]interface{})
	p.p["vcsdeviceid"] = vcsdeviceid
	return p
}
620940
func TrimSACKBlockList(sack *SACKInfo, rcvNxt seqnum.Value) {
	n := 0
	for i := 0; i < sack.NumBlocks; i++ {
		if sack.Blocks[i].End.LessThanEq(rcvNxt) {
			continue
		}
		if sack.Blocks[i].Start.LessThan(rcvNxt) {
			// Shrink this SACK block.
			sack.Blocks[i].Start = rcvNxt
		}
		sack.Blocks[n] = sack.Blocks[i]
		n++
	}
	sack.NumBlocks = n
}
1075721
func (ns *Namespace) TrimRight(cutset, s interface{}) (string, error) {
	ss, err := cast.ToStringE(s)
	if err != nil {
		return "", err
	}

	sc, err := cast.ToStringE(cutset)
	if err != nil {
		return "", err
	}

	return _strings.TrimRight(ss, sc), nil
}
523737
func (tp *TicketPool) trim() (int64, PoolDiff) {
	if tp.tip == 0 || len(tp.diffs) == 0 {
		return tp.tip, PoolDiff{}
	}
	tp.tip--
	newMaxCursor := tp.maxCursor()
	if tp.cursor > newMaxCursor {
		if err := tp.retreatTo(newMaxCursor); err != nil {
			log.Errorf("retreatTo failed: %v", err)
		}
	}
	// Trim AFTER retreating
	undo := tp.diffs[len(tp.diffs)-1]
	tp.diffs = tp.diffs[:len(tp.diffs)-1]
	return tp.tip, undo
}
1035546
func trim(s string) string {
	for len(s) > 0 {
		if s[0] <= ' ' {
			s = s[1:]
			continue
		}
		break
	}
	for len(s) > 0 {
		if s[len(s)-1] <= ' ' {
			s = s[:len(s)-1]
			continue
		}
		break
	}
	return s
}
1068699
func (d *JSONDecoder) DecodeHistoryRemove(data []byte) (*HistoryRemoveRequest, error) {
	var p HistoryRemoveRequest
	err := json.Unmarshal(data, &p)
	if err != nil {
		return nil, err
	}
	return &p, nil
}
85260
func trim(a *decimal) {
	for a.nd > 0 && a.d[a.nd-1] == '0' {
		a.nd--
	}
	if a.nd == 0 {
		a.dp = 0
	}
}
923982
func (tp *TicketPool) Trim() (int64, PoolDiff) {
	tp.mtx.Lock()
	defer tp.mtx.Unlock()
	return tp.trim()
}
390908
func buildRollbarFrames(callers []uintptr) (frames rollbarFrames) {
	frames = rollbarFrames{}

	// 2016-08-24 - runtime.CallersFrames was added in Go 1.7, which should
	// replace the following code when roll is able to require Go 1.7+.
	for _, caller := range callers {
		frame := rollbarFrame{
			Filename: "???",
			Method:   "???",
		}
		if fn := runtime.FuncForPC(caller); fn != nil {
			name, line := fn.FileLine(caller)
			frame.Filename = scrubFile(name)
			frame.Line = line
			frame.Method = scrubFunction(fn.Name())
		}
		frames = append(frames, frame)
	}

	return frames
}
109040
func (s *Facade) Prune(maxHistoryTime time.Duration, maxHistoryMB int) error {
	p := params.StatusHistoryPruneArgs{
		MaxHistoryTime: maxHistoryTime,
		MaxHistoryMB:   maxHistoryMB,
	}
	return s.facade.FacadeCall("Prune", p, nil)
}
548977
func (c *Context) FrameBufferRenderBuffer(target, attachment, renderbufferTarget int, renderbuffer *js.Object) {
	c.Call("framebufferRenderBuffer", target, attachment, renderbufferTarget, renderbuffer)
}
277261
func TrimTrailingSpaces(p []byte) []byte {
	for i := len(p) - 1; i >= 0; i-- {
		if p[i] != 0x20 && p[i] != '\n' && p[i] != '\t' {
			return p[:i+1]
		}
	}
	// it was all spaces
	return p[:0]
}
44789
func normalizeBlocks(a []Block) []Block {
	a = joinAdjacentTextBlocks(a)
	a = trimTrailingEmptyTextBlocks(a)
	return a
}
21856
func (mpi *MempoolInfo) Trim() *TrimmedMempoolInfo {
	mpi.RLock()

	mempoolRegularTxs := TrimMempoolTx(mpi.Transactions)
	mempoolVotes := TrimMempoolTx(mpi.Votes)

	data := &TrimmedMempoolInfo{
		Transactions: FilterRegularTx(mempoolRegularTxs),
		Tickets:      TrimMempoolTx(mpi.Tickets),
		Votes:        FilterUniqueLastBlockVotes(mempoolVotes),
		Revocations:  TrimMempoolTx(mpi.Revocations),
		Total:        mpi.TotalOut,
		Time:         mpi.LastBlockTime,
	}

	mpi.RUnlock()

	// Calculate total fees for all mempool transactions.
	getTotalFee := func(txs []*TrimmedTxInfo) dcrutil.Amount {
		var sum dcrutil.Amount
		for _, tx := range txs {
			sum += tx.TxBasic.Fee
		}
		return sum
	}

	allFees := getTotalFee(data.Transactions) + getTotalFee(data.Revocations) +
		getTotalFee(data.Tickets) + getTotalFee(data.Votes)
	data.Fees = allFees.ToCoin()

	return data
}
531939
func (tag *Tag) DeleteFrames(id string) {
	delete(tag.frames, id)
	if s, ok := tag.sequences[id]; ok {
		putSequence(s)
		delete(tag.sequences, id)
	}
}