couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r697512 - /incubator/couchdb/trunk/src/mochiweb/mochijson2.erl
Date Sun, 21 Sep 2008 13:23:11 GMT
Author: jchris
Date: Sun Sep 21 06:23:11 2008
New Revision: 697512

URL: http://svn.apache.org/viewvc?rev=697512&view=rev
Log:
change integer handling in mochijson2 to fix JSON regression COUCHDB-118

Modified:
    incubator/couchdb/trunk/src/mochiweb/mochijson2.erl

Modified: incubator/couchdb/trunk/src/mochiweb/mochijson2.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/mochiweb/mochijson2.erl?rev=697512&r1=697511&r2=697512&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/mochiweb/mochijson2.erl (original)
+++ incubator/couchdb/trunk/src/mochiweb/mochijson2.erl Sun Sep 21 06:23:11 2008
@@ -93,11 +93,8 @@
     <<"false">>;
 json_encode(null, _State) ->
     <<"null">>;
-json_encode(I, _State) when is_integer(I) andalso I >= -2147483648 andalso I =< 2147483647
->
-    %% Anything outside of 32-bit integers should be encoded as a float
-    integer_to_list(I);
 json_encode(I, _State) when is_integer(I) ->
-    mochinum:digits(float(I));
+    integer_to_list(I);
 json_encode(F, _State) when is_float(F) ->
     mochinum:digits(F);
 json_encode(S, State) when is_binary(S); is_atom(S) ->



Mime
View raw message