Skip to content

Commit c96e5dc

Browse files
author
Jarret Lavallee
committed
Allow for coalescing boolean values
Prior to this commit, the coalesce method would not properlly handle boolean values. It would return the default `true` if coalescing a `false` value. This commit updates the logic to be able to handle booleans correctly.
1 parent 2834b35 commit c96e5dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/pe_metrics.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
config = YAML.load_file(config_file)
3131

3232
def coalesce(higher_precedence, lower_precedence, default = nil)
33-
[higher_precedence, lower_precedence].find{|x|!x.nil?} || default
33+
[higher_precedence, lower_precedence, default].find{|x|!x.nil?}
3434
end
3535

3636
METRICS_TYPE = options[:metrics_type]

0 commit comments

Comments
 (0)