//Clone makes a new clone of this collector
13994
func (c Collector) Clone() Collector {
	col := make(Collector)
	col.Copy(c)
	return col
}
279141
func (c *Container) Clone() (out *Container) {
	statsHit("Container/Clone")
	switch c.typ {
	case containerArray:
		statsHit("Container/Clone/Array")
		cArray := c.array()
		array := make([]uint16, len(cArray))
		copy(array, cArray)
		out = NewContainerArray(array)
	case containerBitmap:
		statsHit("Container/Clone/Bitmap")
		other := NewContainerBitmap(c.n, nil)
		copy(other.bitmap(), c.bitmap())
		out = other
	case containerRun:
		statsHit("Container/Clone/Run")
		cRuns := c.runs()
		runs := make([]interval16, len(cRuns))
		copy(runs, cRuns)
		out = NewContainerRun(runs)
	}
	// this should probably never happen
	if roaringParanoia {
		if out.n != out.count() {
			panic("cloned container has wrong n")
		}
	}
	return out
}
1084728
func (es *EventStream) Clone() *EventStream {
	patient := new(models.Patient)
	if es.Patient != nil {
		*patient = *es.Patient
	}
	events := make([]Event, len(es.Events))
	copy(events, es.Events)
	return &EventStream{
		Patient: patient,
		Events:  events,
	}
}
475938
func (r *Reference) Clone() *Reference {
	if r == nil {
		return nil
	}
	cr := *r
	if len(cr.otherTags) != 0 {
		cr.otherTags = make([]tagPair, len(cr.otherTags))
	}
	copy(cr.otherTags, r.otherTags)
	cr.owner = nil
	cr.id = -1
	if r.uri != nil {
		cr.uri = &url.URL{}
		*cr.uri = *r.uri
		if r.uri.User != nil {
			cr.uri.User = &url.Userinfo{}
			*cr.uri.User = *r.uri.User
		}
	}
	return &cr
}
253940
func (bv Values) Clone() Values {
	if n := len(bv); n > 0 {
		values := make(Values, n, n)
		copy(values, bv)
		return values
	}

	return NewValues()
}
440095
func (db *DBInfo) Clone() *DBInfo {
	newInfo := *db
	newInfo.Tables = make([]*TableInfo, len(db.Tables))
	for i := range db.Tables {
		newInfo.Tables[i] = db.Tables[i].Clone()
	}
	return &newInfo
}
1200304
func (n *NkeyUser) clone() *NkeyUser {
	if n == nil {
		return nil
	}
	clone := &NkeyUser{}
	*clone = *n
	clone.Permissions = n.Permissions.clone()
	return clone
}
833000
func (c *MutableTLSCreds) Clone() credentials.TransportCredentials {
	c.Lock()
	newCfg, err := NewMutableTLS(c.config.Clone())
	if err != nil {
		panic("validation error on Clone")
	}
	c.Unlock()
	return newCfg
}
456891
func (c ClusterOperationInstance) Clone() ClusterOperationInstance {
	var clone = c
	clone.ClusterOperation = *(proto.Clone(&c.ClusterOperation).(*automationpb.ClusterOperation))
	return clone
}
1035892
func (n *node) clone() *node {
	return &node{
		value:    n.value,
		children: n.cloneChildren(),
	}
}
1203559
func (p *Partitions) clone() *Partitions {
	replicas := make([][]*Node, len(p.Replicas))

	for i := range p.Replicas {
		r := make([]*Node, len(p.Replicas[i]))
		copy(r, p.Replicas[i])
		replicas[i] = r
	}

	regimes := make([]int, len(p.regimes))
	copy(regimes, p.regimes)

	return &Partitions{
		Replicas: replicas,
		CPMode:   p.CPMode,
		regimes:  regimes,
	}
}
859569
func (p *Pie) Clone(generateNewID bool) *Pie {
	cloned := *p
	if generateNewID {
		cloned.Id = bson.NewObjectId()
	}
	cloned.Slices = make([]Slice, len(p.Slices))
	copy(cloned.Slices, p.Slices)
	return &cloned
}
938023
func (entry *UtxoEntry) Clone() *UtxoEntry {
	if entry == nil {
		return nil
	}

	return &UtxoEntry{
		amount:      entry.amount,
		pkScript:    entry.pkScript,
		blockHeight: entry.blockHeight,
		packedFlags: entry.packedFlags,
	}
}
1015619
func (f *FormatEncoder) Clone() zapcore.Encoder {
	return &FormatEncoder{
		Encoder:    f.Encoder.Clone(),
		formatters: f.formatters,
		pool:       f.pool,
	}
}
877120
func (d *D) Clone() *D {
	return &D{
		Values:   d.Values.Clone(),
		hijacker: d.hijacker,
		goodFunc: d.goodFunc,
	}
}
862211
func (c *CheckState) Clone() *CheckState {
	c2 := new(CheckState)
	*c2 = *c
	return c2
}
193661
func (s *ServiceState) Clone() *ServiceState {
	s2 := new(ServiceState)
	*s2 = *s
	return s2
}