Replace m[k]=v loop with maps.Copy

This commit is contained in:
Holger Obermaier
2026-02-06 14:50:00 +01:00
parent baf7a4f2c5
commit 77a9b5a977
3 changed files with 7 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ package metricAggregator
import (
"context"
"fmt"
"maps"
"math"
"os"
"strings"
@@ -121,9 +122,7 @@ func (c *metricAggregator) Init(output chan lp.CCMessage) error {
func (c *metricAggregator) Eval(starttime time.Time, endtime time.Time, metrics []lp.CCMessage) {
vars := make(map[string]interface{})
for k, v := range c.constants {
vars[k] = v
}
maps.Copy(vars, c.constants)
vars["starttime"] = starttime
vars["endtime"] = endtime
for _, f := range c.functions {