diff --git a/report/controls.go b/report/controls.go index 02e87a5b8..9f2815fbf 100644 --- a/report/controls.go +++ b/report/controls.go @@ -56,11 +56,11 @@ type NodeControls struct { Controls StringSet } +var emptyNodeControls = NodeControls{Controls: MakeStringSet()} + // MakeNodeControls makes a new NodeControls func MakeNodeControls() NodeControls { - return NodeControls{ - Controls: MakeStringSet(), - } + return emptyNodeControls } // Copy is a noop, as NodeControls is immutable diff --git a/report/metrics.go b/report/metrics.go index ea1122c92..036c0089e 100644 --- a/report/metrics.go +++ b/report/metrics.go @@ -65,11 +65,13 @@ func MakeSingletonMetric(t time.Time, v float64) Metric { } +var emptyMetric = Metric{} + // MakeMetric makes a new Metric from unique samples incrementally ordered in // time. func MakeMetric(samples []Sample) Metric { if len(samples) < 1 { - return Metric{} + return emptyMetric } var (