Skip to content

Commit bf7b684

Browse files
authored
Merge pull request #181 from ekohl/use-max_by
Use max_by to determine the maximum value
2 parents 50cff16 + a3c9b6b commit bf7b684

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rspec-puppet-facts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def self.facter_version_for_puppet_version(puppet_version)
405405
return Facter.version
406406
end
407407

408-
applicable_versions.sort { |a, b| b.first <=> a.first }.first.last
408+
applicable_versions.max_by { |p, _| p }.last
409409
rescue JSON::ParserError
410410
warning "#{json_path} contains invalid JSON, defaulting to Facter #{Facter.version}"
411411
Facter.version

0 commit comments

Comments
 (0)