// Absorb fills the internal State of the sponge with the given trits.
16659
func (c *Curl) Absorb(in Trits) error {
	var lenn int
	for i := 0; i < len(in); i += lenn {
		lenn = HashTrinarySize

		if len(in)-i < HashTrinarySize {
			lenn = len(in) - i
		}

		copy(c.State, in[i:i+lenn])
		c.Transform()
	}
	return nil
}
1066386
func (stats *Stats) Clear() {
	stats.durations = stats.durations[:0]
	stats.histogram = nil
	stats.dirty = false
	stats.result = BenchResults{}
}
963753
func (dc *Context) Clear() {
	src := image.NewUniform(dc.color)
	draw.Draw(dc.im, dc.im.Bounds(), src, image.ZP, draw.Src)
}
172395
func Apply(proposal *peer.Proposal, input *peer.ChaincodeInput,
	decorators ...Decorator) *peer.ChaincodeInput {
	for _, decorator := range decorators {
		input = decorator.Decorate(proposal, input)
	}

	return input
}
1039873
func (t *Trie) Insert(key string) {
	curNode := t.root
	for _, v := range key {
		if curNode.child[v] == nil {
			curNode.child[v] = newNode()
		}
		curNode = curNode.child[v]
	}

	if !curNode.exists {
		// increment when new rune child is added.
		t.size++
		curNode.exists = true
	}
	// value is stored for retrieval in future.
	curNode.value = key
}
974401
func Bind(cleanup func()) {
	c.sem.Lock()
	// store in the reverse order
	s := make([]func(), 0, 1+len(c.cleanups))
	s = append(s, cleanup)
	c.cleanups = append(s, c.cleanups...)
	c.sem.Unlock()
}
748496
func (t *Iterator) Consume(cnt int) {
	for i := 0; i < cnt; i++ {
		token := t.Next()
		if token.Type == tError || token.Type == tEOF {
			t.Backup()
			break
		}
	}
}
1259147
func (b *Buffer) consume(n int) ([]byte, bool) {
	if !b.Has(n) {
		return nil, false
	}
	rval := b.data[:n]
	b.data = b.data[n:]
	return rval, true
}
375929
func (txt *Text) Clear() {
	txt.prevR = -1
	txt.bounds = pixel.Rect{}
	txt.tris.SetLen(0)
	txt.dirty = true
	txt.Dot = txt.Orig
}
134779
func (t *Trie) Clear() {
	t.root.internal = nil
	t.root.external = nil
	t.size = 0
}
957616
func (t *Trie) Remove(key string) {
	var (
		i    int
		rs   = []rune(key)
		node = findNode(t.Root(), []rune(key))
	)

	t.mu.Lock()
	defer t.mu.Unlock()

	t.size--
	for n := node.Parent(); n != nil; n = n.Parent() {
		i++
		if len(n.Children()) > 1 {
			r := rs[len(rs)-i]
			n.RemoveChild(r)
			break
		}
	}
}
1047662
func (c *Curl) AbsorbTrytes(inn Trytes) error {
	var in Trits
	var err error

	if len(inn) == 0 {
		in = Trits{0}
	} else {
		in, err = TrytesToTrits(inn)
		if err != nil {
			return err
		}
	}
	return c.Absorb(in)
}
1053255
func (e *structured) Fill(m context.Map) {
	if e != nil {
		if e.cause != nil {
			// Include data from cause, which supercedes context
			e.cause.Fill(m)
		}
		// Include the context, which supercedes the cause
		for key, value := range e.context {
			m[key] = value
		}
		// Now include the error's data, which supercedes everything
		for key, value := range e.data {
			m[key] = value
		}
	}
}
393096
func (cp *callPool) Clear(fn func(c *Call)) {
	cp.Lock()
	for k, c := range cp.pending {
		fn(c)
		delete(cp.pending, k)
	}
	cp.Unlock()
}
219236
func (r *Render) clear(cursor int) {
	r.move(cursor, 0)
	r.out.EraseDown()
}
486676
func (b *Buffer) Consume(n int) []byte {
	v, ok := b.consume(n)
	if !ok {
		return nil
	}
	return v
}
613696
func (c *BufferLRU) Clear() {
	c.mut.Lock()
	defer c.mut.Unlock()

	c.ll = nil
	c.cache = nil
	c.actualSize = 0
}