Skip to content

Commit b7081ea

Browse files
authored
Performance: simplifed checking for reserved label keyword (#705)
1 parent ce52b0f commit b7081ea

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/summary.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class Summary extends Metric {
1818
store: new LabelMap(),
1919
});
2020

21+
if (this.labelNames.includes('quantile'))
22+
throw new Error('quantile is a reserved label keyword');
23+
2124
this.type = 'summary';
2225
this.store = new LabelMap(this.labelNames);
2326

@@ -31,10 +34,6 @@ class Summary extends Metric {
3134
},
3235
);
3336
}
34-
for (const label of this.labelNames) {
35-
if (label === 'quantile')
36-
throw new Error('quantile is a reserved label keyword');
37-
}
3837
}
3938

4039
/**

0 commit comments

Comments
 (0)