Skip to content

Commit

Permalink
removing unused function return
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Tanaka <[email protected]>
  • Loading branch information
pedro-stanaka committed Oct 25, 2023
1 parent 0239f9f commit 7887764
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion execution/aggregate/hashaggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (a *aggregate) initializeScalarTables(ctx context.Context) ([]aggregateTabl
labelsMap[lblName] = struct{}{}
}
for i := 0; i < len(series); i++ {
hash, _, lbls := hashMetric(builder, series[i], !a.by, a.labels, labelsMap, hashingBuf)
hash, lbls := hashMetric(builder, series[i], !a.by, a.labels, labelsMap, hashingBuf)
output, ok := outputMap[hash]
if !ok {
output = &model.Series{
Expand Down
2 changes: 1 addition & 1 deletion execution/aggregate/khashaggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (a *kAggregate) init(ctx context.Context) error {
labelsMap[lblName] = struct{}{}
}
for i := 0; i < len(series); i++ {
hash, _, _ := hashMetric(builder, series[i], !a.by, a.labels, labelsMap, hashingBuf)
hash, _ := hashMetric(builder, series[i], !a.by, a.labels, labelsMap, hashingBuf)
h, ok := heapsHash[hash]
if !ok {
h = &samplesHeap{compare: a.compare}
Expand Down
12 changes: 6 additions & 6 deletions execution/aggregate/scalar_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func hashMetric(
grouping []string,
groupingSet map[string]struct{},
buf []byte,
) (uint64, string, labels.Labels) {
) (uint64, labels.Labels) {
buf = buf[:0]
builder.Reset()

Expand All @@ -123,12 +123,12 @@ func hashMetric(
}
builder.Add(lbl.Name, lbl.Value)
})
key, bytes := metric.HashWithoutLabels(buf, grouping...)
return key, string(bytes), builder.Labels()
key, _ := metric.HashWithoutLabels(buf, grouping...)
return key, builder.Labels()
}

if len(grouping) == 0 {
return 0, "", labels.Labels{}
return 0, labels.Labels{}
}

metric.Range(func(lbl labels.Label) {
Expand All @@ -137,8 +137,8 @@ func hashMetric(
}
builder.Add(lbl.Name, lbl.Value)
})
key, bytes := metric.HashForLabels(buf, grouping...)
return key, string(bytes), builder.Labels()
key, _ := metric.HashForLabels(buf, grouping...)
return key, builder.Labels()
}

type newAccumulatorFunc func() *accumulator
Expand Down

0 comments on commit 7887764

Please sign in to comment.