Write() directly into hash and use model.SeparatorByte.

This commit is contained in:
Julius Volz 2015-02-21 17:19:13 +01:00
parent 645cf57bed
commit 7fefccd929
1 changed files with 2 additions and 2 deletions

View File

@ -375,8 +375,8 @@ func (node *ScalarFunctionCall) Eval(timestamp clientmodel.Timestamp) clientmode
func (node *VectorAggregation) labelsToGroupingKey(labels clientmodel.Metric) uint64 { func (node *VectorAggregation) labelsToGroupingKey(labels clientmodel.Metric) uint64 {
summer := fnv.New64a() summer := fnv.New64a()
for _, label := range node.groupBy { for _, label := range node.groupBy {
fmt.Fprint(summer, labels[label]) summer.Write([]byte(labels[label]))
fmt.Fprint(summer, []byte{0}) summer.Write([]byte{clientmodel.SeparatorByte})
} }
return summer.Sum64() return summer.Sum64()