Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed yuki24's code a little

  • Loading branch information...
commit 612887f1cc4902d9c99ee39be5e3c913e7aaa509 1 parent 4754d6c
@ohler55 authored
Showing with 14 additions and 5 deletions.
  1. +2 −2 README.md
  2. +3 −1 ext/oj/dump.c
  3. +1 −1  lib/oj/version.rb
  4. +8 −1 notes
View
4 README.md
@@ -32,9 +32,9 @@ A fast JSON parser and Object marshaller as a Ruby gem.
## <a name="release">Release Notes</a>
-### Release 1.4.7
+### Release 1.4.8
- - In compat mode non-String keys are converted to Strings instead of raising and error. (issue #52)
+ - Thanks to yuki24 Floats are now output with a decimal even if they are an integer value.
## <a name="description">Description</a>
View
4 ext/oj/dump.c
@@ -436,8 +436,10 @@ dump_float(VALUE obj, Out out) {
} else if (-INFINITY == d) {
strcpy(buf, "-Infinity");
cnt = 9;
+ } else if (d == (double)(long long int)d) {
+ cnt = sprintf(buf, "%.1f", d); // used sprintf due to bug in snprintf
} else {
- cnt = sprintf(buf, (d - ((long)d)) ? "%0.16g" : "%.1f", d); // used sprintf due to bug in snprintf
+ cnt = sprintf(buf, "%0.16g", d); // used sprintf due to bug in snprintf
}
if (out->end - out->cur <= (long)cnt) {
grow(out, cnt);
View
2  lib/oj/version.rb
@@ -1,5 +1,5 @@
module Oj
# Current version of the module.
- VERSION = '1.4.7'
+ VERSION = '1.4.8'
end
View
9 notes
@@ -3,7 +3,14 @@
^c^d hide subtree
^c^s show subtree
-- memory leak on bad json
+- prepop
+ - write perf test for 10 arrays and some numbers
+ - separate out new array function (inline)
+ - create queue
+ - circular with floating insert and pop pointers
+ - mark unused as Qnil
+ - if one not available, create it in the normal way
+ - use for array, hash, and object
- next

1 comment on commit 612887f

Please sign in to comment.
Something went wrong with that request. Please try again.