Skip to content

Commit

Permalink
Address review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaMadhushan committed Aug 2, 2024
1 parent 71215d6 commit 0c54a06
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ballerina/natives.bal
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ public isolated class Counter {
} else {
self.description = "";
}
if (tags is map<string>) {
self.metricTags = tags.cloneReadOnly();
} else {
self.metricTags = DEFAULT_TAGS;
}
self.metricTags = tags is map<string> ? tags.cloneReadOnly() : DEFAULT_TAGS;
externCounterInit(self);
}

Expand Down Expand Up @@ -225,8 +221,8 @@ public isolated class Gauge {
StatisticConfig[]? statisticConfig = ()) {
self.name = name;
self.description = desc ?: "";
self.metricTags = tags.cloneReadOnly() ?: DEFAULT_TAGS;
self.statisticConfigs = statisticConfig.cloneReadOnly() ?: defaultGaugeStatsConfig;
self.metricTags = tags is () ? DEFAULT_TAGS : tags.cloneReadOnly();
self.statisticConfigs = statisticConfig is () ? defaultGaugeStatsConfig : statisticConfig.cloneReadOnly();
externGaugeInit(self);
}

Expand Down

0 comments on commit 0c54a06

Please sign in to comment.