Skip to content

Commit db1edda

Browse files
committed
Simplify some_default_match logic
Prior to this commit, the Puppet::Provider.some_default_match method used a case statement to determine whether to match facts or feature. Because that case statement only had one condition, this commit simplifies the logic to instead use a ternary if.
1 parent 013a7b3 commit db1edda

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/puppet/provider.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,7 @@ def self.default_match
273273
def self.some_default_match(defaultlist)
274274
defaultlist.find do |default|
275275
default.all? do |key, values|
276-
case key
277-
when :feature
278-
feature_match(values)
279-
else
280-
fact_match(key, values)
281-
end
276+
key == :feature ? feature_match(values) : fact_match(key, values)
282277
end
283278
end
284279
end

0 commit comments

Comments
 (0)