Skip to content

Commit a3660c8

Browse files
committed
Switch code style for meta nil removal
To make it more readable See also #364 (comment)
1 parent b447780 commit a3660c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/helper/app_size_metrics_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def meta=(hash)
3333
#
3434
def add_metric(name:, value:, meta: nil)
3535
metric = { name: name, value: value }
36-
meta = (meta || {}).compact # Remove nil values if any
36+
meta = meta&.compact || {} # Remove nil values if any (and use empty Hash if nil was provided)
3737
metric[:meta] = meta.map { |meta_key, meta_value| { name: meta_key.to_s, value: meta_value } } unless meta.empty?
3838
@metrics.append(metric)
3939
end

0 commit comments

Comments
 (0)