Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* ext/psych/lib/psych/scalar_scanner.rb: use constants rather than

  calculating Inf and NaN.
  • Loading branch information...
commit 2e8f82404c3911618e3dc3bec3a9e5e6b414f95a 1 parent e3a7fce
@tenderlove authored
Showing with 8 additions and 3 deletions.
  1. +5 −0 CHANGELOG.rdoc
  2. +3 −3 lib/psych/scalar_scanner.rb
View
5 CHANGELOG.rdoc
@@ -1,3 +1,8 @@
+Thu Jan 17 10:48:56 2013 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/scalar_scanner.rb: use constants rather than
+ calculating Inf and NaN.
+
Sun Jan 13 16:40:00 2013 Zachary Scott <zachary@zacharyscott.net>
* ext/psych/yaml/scanner.c: Typos by James Dabbs [Github Fixes #118]
View
6 lib/psych/scalar_scanner.rb
@@ -68,11 +68,11 @@ def tokenize string
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
Please sign in to comment.
Something went wrong with that request. Please try again.