couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r957656 - /couchdb/trunk/src/mochiweb/mochijson2.erl
Date Thu, 24 Jun 2010 18:07:00 GMT
Author: jchris
Date: Thu Jun 24 18:07:00 2010
New Revision: 957656

URL: http://svn.apache.org/viewvc?rev=957656&view=rev
Log:
patch mochijson2 to allow output of big integers not in float form (it stores them just fine)

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

Modified: couchdb/trunk/src/mochiweb/mochijson2.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/mochiweb/mochijson2.erl?rev=957656&r1=957655&r2=957656&view=diff
==============================================================================
--- couchdb/trunk/src/mochiweb/mochijson2.erl (original)
+++ couchdb/trunk/src/mochiweb/mochijson2.erl Thu Jun 24 18:07:00 2010
@@ -98,11 +98,8 @@ json_encode(false, _State) ->
     <<"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