From 0c54a06b70900e8f60df62072d06be508808f9b2 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Fri, 2 Aug 2024 17:31:39 +0530 Subject: [PATCH] Address review suggestions --- ballerina/natives.bal | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ballerina/natives.bal b/ballerina/natives.bal index 6692c4d..ca77e69 100644 --- a/ballerina/natives.bal +++ b/ballerina/natives.bal @@ -123,11 +123,7 @@ public isolated class Counter { } else { self.description = ""; } - if (tags is map) { - self.metricTags = tags.cloneReadOnly(); - } else { - self.metricTags = DEFAULT_TAGS; - } + self.metricTags = tags is map ? tags.cloneReadOnly() : DEFAULT_TAGS; externCounterInit(self); } @@ -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); }