From 679a646e377340177666688c2d6baa3e0bbb140b Mon Sep 17 00:00:00 2001 From: tenderlove Date: Thu, 17 Jan 2013 01:49:55 +0000 Subject: * ext/psych/lib/psych/scalar_scanner.rb: use constants rather than calculating Inf and NaN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/scalar_scanner.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb index 575945990f..8aa594e333 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/lib/psych/scalar_scanner.rb @@ -68,11 +68,11 @@ module Psych string end when /^\.inf$/i - 1 / 0.0 + Float::INFINITY when /^-\.inf$/i - -1 / 0.0 + -Float::INFINITY when /^\.nan$/i - 0.0 / 0.0 + Float::NAN when /^:./ if string =~ /^:(["'])(.*)\1/ @symbol_cache[string] = $2.sub(/^:/, '').to_sym -- cgit v1.2.3