Skip to content

Commit 5822772

Browse files
committed
simplify null checking statement
1 parent 2ec97c5 commit 5822772

File tree

1 file changed

+1
-4
lines changed
  • packages/performance/src/resources

1 file changed

+1
-4
lines changed

packages/performance/src/resources/trace.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@ export class Trace implements PerformanceTrace {
185185
*/
186186
putMetric(counter: string, numAsInteger: number): void {
187187
if (isValidMetricName(counter, this.name)) {
188-
this.counters[counter] =
189-
numAsInteger === undefined
190-
? 0
191-
: convertMetricValueToInteger(numAsInteger);
188+
this.counters[counter] = convertMetricValueToInteger(numAsInteger ?? 0);
192189
} else {
193190
throw ERROR_FACTORY.create(ErrorCode.INVALID_CUSTOM_METRIC_NAME, {
194191
customMetricName: counter

0 commit comments

Comments
 (0)