chore(promql): return the group slot directly

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
This commit is contained in:
Dennis Zhuang
2026-10-22 05:40:15 +08:00
parent 8bc2c8aa55
commit 7e0325780e
+2 -3
View File
@@ -74,11 +74,10 @@ pub fn evaluate_histograms(
let mut index: HashMap<LabelSet, usize> = HashMap::new();
let mut groups: Vec<Group<'_>> = Vec::new();
let mut group_of = |metric: MetricName| {
let slot = *index.entry(label_set(&metric)).or_insert_with(|| {
*index.entry(label_set(&metric)).or_insert_with(|| {
groups.push(Group::new(metric));
groups.len() - 1
});
slot
})
};
let mut members: Vec<(usize, Option<f64>, &Series)> = Vec::new();
for series in series {