// Reset discards the writer's state and switches the Snappy writer to write to
// w. This permits reusing a Writer rather than allocating a new one.
329147
func (w *Writer) Reset(writer io.Writer) {
	w.w = writer
	w.err = nil
	w.wroteHeader = false
}
605207
func (w *Writer) Reset() {
	w.mtx.Lock()
	defer w.mtx.Unlock()
	w.Buf.Reset()
	w.lineCount = 0
}
517214
func (d *Decoder) Reset(r io.Reader) error {
	if d.current.err == ErrDecoderClosed {
		return d.current.err
	}
	if r == nil {
		return errors.New("nil Reader sent as input")
	}

	// TODO: If r is a *bytes.Buffer, we could automatically switch to sync operation.

	if d.stream == nil {
		d.stream = make(chan decodeStream, 1)
		go d.startStreamDecoder(d.stream)
	}

	d.drainOutput()

	// Remove current block.
	d.current.decodeOutput = decodeOutput{}
	d.current.err = nil
	d.current.cancel = make(chan struct{})
	d.current.flushed = false
	d.current.d = nil

	d.stream <- decodeStream{
		r:      r,
		output: d.current.output,
		cancel: d.current.cancel,
	}
	return nil
}
290230
func (c *Chunk) Reset() {
	if c.columns == nil {
		return
	}
	for _, col := range c.columns {
		col.reset()
	}
	c.numVirtualRows = 0
}
1276742
func (buffer *BufferedReader) Reset(sequence uint64) {
	buffer.end = 0
	buffer.incomplete = true
}
606576
func (e *Encoder) Reset(w io.Writer) {
	if w == nil {
		return
	}
	// var ok bool
	e.bytes = false
	if e.wf == nil {
		e.wf = new(bufioEncWriter)
	}
	// e.typ = entryTypeUnset
	// if e.h.WriterBufferSize > 0 {
	// 	// bw := bufio.NewWriterSize(w, e.h.WriterBufferSize)
	// 	// e.wi.bw = bw
	// 	// e.wi.sw = bw
	// 	// e.wi.fw = bw
	// 	// e.wi.ww = bw
	// 	if e.wf == nil {
	// 		e.wf = new(bufioEncWriter)
	// 	}
	// 	e.wf.reset(w, e.h.WriterBufferSize)
	// 	e.typ = entryTypeBufio
	// } else {
	// 	if e.wi == nil {
	// 		e.wi = new(ioEncWriter)
	// 	}
	// 	e.wi.reset(w)
	// 	e.typ = entryTypeIo
	// }
	e.wf.reset(w, e.h.WriterBufferSize)
	// e.typ = entryTypeBufio

	// e.w = e.wi
	e.resetCommon()
}
240176
func (s *Storage) Reset() {
	s.setBuntDB(storage.TotalCountKey, 0)
	s.setBuntDB(storage.IosSuccessKey, 0)
	s.setBuntDB(storage.IosErrorKey, 0)
	s.setBuntDB(storage.AndroidSuccessKey, 0)
	s.setBuntDB(storage.AndroidErrorKey, 0)
}
703372
func Reset(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.Reset()
	}
	return value{value: arg}
}
343626
func (b *Batch) Reset() {
	b.internal.Reset()
	b.lastDocSize = 0
	b.totalSize = 0
}
239992
func (c *CipherWriter) Reset(w io.Writer, mask [4]byte) {
	c.w = w
	c.mask = mask
	c.pos = 0
}
406387
func (enc *ProtoEncoder) Reset(w io.Writer) {
	enc.pBuf.Reset()
	enc.w = w
}
1184996
func (m *MemLogger) Reset() {
	if m.lock != nil {
		m.lock.Lock()
		defer m.lock.Unlock()
	}
	if m.data != nil {
		*m.data = nil
	}
}
869845
func (d *State364) Reset() {
	d.pc = uint32(d.seed)
	d.pb = uint32(d.seed >> 32)
	d.clen = 0
	d.tail = nil
}
552304
func (w *Writer) Reset(dst io.Writer) {
	if dw, ok := w.d.w.writer.(*dictWriter); ok {
		// w was created with NewWriterDict
		dw.w = dst
		w.d.reset(dw)
		w.d.fillWindow(w.dict)
	} else {
		// w was created with NewWriter
		w.d.reset(dst)
	}
}
281327
func (w *Writer) Reset() {
	if w.structRef != nil {
		for k := range w.structRef {
			delete(w.structRef, k)
		}
	}
	if w.Simple {
		return
	}
	w.refCount = 0
	if w.ref != nil {
		for k := range w.ref {
			delete(w.ref, k)
		}
	}
	if w.typeRef != nil {
		w.typeRef = w.typeRef[:0]
	}
}
1328719
func (c *Context) reset() {
	c.Writer = &c.writermem
	c.Params = c.Params[0:0]
	c.handlers = nil
	c.index = -1
	c.Keys = nil
	c.Errors = c.Errors[0:0]
	c.Accepted = nil
}
1282846
func (d *state) Reset() {
	// Zero the permutation's state.
	for i := range d.a {
		d.a[i] = 0
	}
	d.state = spongeAbsorbing
	d.buf = d.storage[:0]
}