// Clone clones a Range.
493307
func (ran *Range) Clone() *Range {
	newRange := &Range{
		LowVal:      make([]types.Datum, 0, len(ran.LowVal)),
		HighVal:     make([]types.Datum, 0, len(ran.HighVal)),
		LowExclude:  ran.LowExclude,
		HighExclude: ran.HighExclude,
	}
	for i, length := 0, len(ran.LowVal); i < length; i++ {
		newRange.LowVal = append(newRange.LowVal, ran.LowVal[i])
	}
	for i, length := 0, len(ran.HighVal); i < length; i++ {
		newRange.HighVal = append(newRange.HighVal, ran.HighVal[i])
	}
	return newRange
}
1030390
func (k *Keyspace) Clone() *Keyspace {
	return &Keyspace{Start: k.Start, End: k.End}
}
569647
func (b *Backend) Clone() *Backend {
	var c Backend
	c.Copy(b)
	return &c
}
872465
func (s *Set) Clone() *Set {
	items := make([]string, len(s.items))
	copy(items, s.items)
	return &Set{items}
}
13994
func (c Collector) Clone() Collector {
	col := make(Collector)
	col.Copy(c)
	return col
}
990582
func (s *Set) Clone() *Set {
	// Copy set into a new set
	outSet := New()
	for _, v := range s.Enumerate() {
		outSet.Add(v)
	}

	return outSet
}
436336
func (sl *StoreLimits) Clone() *StoreLimits {
	cloned := *sl
	cloned.PerChannel = sl.ClonePerChannelMap()
	return &cloned
}
788040
func (af *avgFunction) Clone() AggregationFunction {
	nf := *af
	for i, arg := range af.Args {
		nf.Args[i] = arg.Clone()
	}
	nf.resultMapper = make(aggCtxMapper)
	return &nf
}
701670
func (p *Params) Clone() *Params {
	if p == nil {
		return NewParams()
	}
	return &Params{
		insCost:        p.insCost,
		subCost:        p.subCost,
		delCost:        p.delCost,
		maxCost:        p.maxCost,
		minScore:       p.minScore,
		bonusPrefix:    p.bonusPrefix,
		bonusScale:     p.bonusScale,
		bonusThreshold: p.bonusThreshold,
	}
}
1081918
func (sf *sumFunction) Clone() AggregationFunction {
	nf := *sf
	for i, arg := range sf.Args {
		nf.Args[i] = arg.Clone()
	}
	nf.resultMapper = make(aggCtxMapper)
	return &nf
}
143671
func (c *Call) Clone() *Call {
	if c == nil {
		return nil
	}

	other := &Call{
		Name: c.Name,
		Args: CopyArgs(c.Args),
	}
	if c.Children != nil {
		other.Children = make([]*Call, len(c.Children))
		for i := range c.Children {
			other.Children[i] = c.Children[i].Clone()
		}
	}
	return other
}
784400
func (buf *FloatBuffer) Clone() Buffer {
	if buf == nil {
		return nil
	}
	newB := &FloatBuffer{}
	newB.Data = make([]float64, len(buf.Data))
	copy(newB.Data, buf.Data)
	newB.Format = &Format{
		NumChannels: buf.Format.NumChannels,
		SampleRate:  buf.Format.SampleRate,
	}
	return newB
}
1163131
func (h *HAConfig) Clone() *HAConfig {
	var c HAConfig
	c.Copy(h)
	return &c
}
456891
func (c ClusterOperationInstance) Clone() ClusterOperationInstance {
	var clone = c
	clone.ClusterOperation = *(proto.Clone(&c.ClusterOperation).(*automationpb.ClusterOperation))
	return clone
}
870108
func (buf *Float32Buffer) Clone() Buffer {
	if buf == nil {
		return nil
	}
	newB := &Float32Buffer{}
	newB.Data = make([]float32, len(buf.Data))
	copy(newB.Data, buf.Data)
	newB.Format = &Format{
		NumChannels: buf.Format.NumChannels,
		SampleRate:  buf.Format.SampleRate,
	}
	return newB
}
97781
func (ki KeyInfo) Clone() KeyInfo {
	result := make([]*Column, 0, len(ki))
	for _, col := range ki {
		result = append(result, col.Clone().(*Column))
	}
	return result
}
1132892
func (c *RollingCounter) Clone() *RollingCounter {
	c.cleanup()
	other := &RollingCounter{
		resolution:  c.resolution,
		values:      make([]int, len(c.values)),
		clock:       c.clock,
		lastBucket:  c.lastBucket,
		lastUpdated: c.lastUpdated,
	}
	copy(other.values, c.values)
	return other
}