CopyFrom copies from other Splits -- we get our own unique copy of everything
(osp *Splits)
| 293 | |
| 294 | // CopyFrom copies from other Splits -- we get our own unique copy of everything |
| 295 | func (spl *Splits) CopyFrom(osp *Splits) { |
| 296 | spl.Splits = make([]*IndexView, len(osp.Splits)) |
| 297 | spl.Values = make([][]string, len(osp.Values)) |
| 298 | for si := range osp.Splits { |
| 299 | spl.Splits[si] = osp.Splits[si].Clone() |
| 300 | spl.Values[si] = slices.Clone(osp.Values[si]) |
| 301 | } |
| 302 | spl.Levels = slices.Clone(osp.Levels) |
| 303 | |
| 304 | nag := len(osp.Aggs) |
| 305 | if nag > 0 { |
| 306 | spl.Aggs = make([]*SplitAgg, nag) |
| 307 | for ai := range osp.Aggs { |
| 308 | spl.Aggs[ai] = osp.Aggs[ai].Clone() |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | // AddAgg adds a new set of aggregation results for the Splits |
| 314 | func (spl *Splits) AddAgg(name string, colIndex int) *SplitAgg { |