()
| 42 | } |
| 43 | |
| 44 | func (s materializedState) clone() materializedState { |
| 45 | if len(s.charts) == 0 { |
| 46 | return newMaterializedState() |
| 47 | } |
| 48 | |
| 49 | out := materializedState{ |
| 50 | charts: make(map[string]*materializedChartState, len(s.charts)), |
| 51 | } |
| 52 | for chartID, chart := range s.charts { |
| 53 | if chart == nil { |
| 54 | continue |
| 55 | } |
| 56 | out.charts[chartID] = chart.clone() |
| 57 | } |
| 58 | return out |
| 59 | } |
| 60 | |
| 61 | func (c *materializedChartState) clone() *materializedChartState { |
| 62 | if c == nil { |