Skip to content

Commit f55d5d5

Browse files
authored
Merge pull request #850 from pmcmaw/min_function
Adding in else additional else statement
2 parents 8f25818 + d9b787a commit f55d5d5

File tree

1 file changed

+5
-2
lines changed
  • lib/puppet/parser/functions

1 file changed

+5
-2
lines changed

lib/puppet/parser/functions/min.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ module Puppet::Parser::Functions
1313
# Sometimes we get numbers as numerics and sometimes as strings.
1414
# We try to compare them as numbers when possible
1515
return args.min do |a, b|
16-
a.to_f <=> b.to_f if a.to_s =~ %r{\A^-?\d+(.\d+)?\z} && b.to_s =~ %r{\A-?\d+(.\d+)?\z}
17-
a.to_s <=> b.to_s
16+
if a.to_s =~ %r{\A^-?\d+(.\d+)?\z} && b.to_s =~ %r{\A-?\d+(.\d+)?\z}
17+
a.to_f <=> b.to_f
18+
else
19+
a.to_s <=> b.to_s
20+
end
1821
end
1922
end
2023
end

0 commit comments

Comments
 (0)