Skip to content

Commit

Permalink
* ext/psych/lib/psych/scalar_scanner.rb: use constants rather than
Browse files Browse the repository at this point in the history
  calculating Inf and NaN.
  • Loading branch information
tenderlove committed Jan 17, 2013
1 parent e3a7fce commit 2e8f824
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
6 changes: 3 additions & 3 deletions lib/psych/scalar_scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e8f824

Please sign in to comment.