couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [26/50] [abbrv] mochiweb commit: updated refs/heads/import-master to 3a54dbf
Date Wed, 12 Feb 2014 06:21:58 GMT
patch mochijson2 to allow output of big integers not in float form (it stores them just fine)

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957656 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/commit/0393fb68
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/tree/0393fb68
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/diff/0393fb68

Branch: refs/heads/import-master
Commit: 0393fb683dbd1c015e5b67b0ae0f56c01dc85778
Parents: ed7cd3d
Author: John Christopher Anderson <jchris@apache.org>
Authored: Thu Jun 24 18:07:00 2010 +0000
Committer: John Christopher Anderson <jchris@apache.org>
Committed: Thu Jun 24 18:07:00 2010 +0000

----------------------------------------------------------------------
 mochijson2.erl | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/blob/0393fb68/mochijson2.erl
----------------------------------------------------------------------
diff --git a/mochijson2.erl b/mochijson2.erl
index 66f68bf..111c37b 100644
--- a/mochijson2.erl
+++ b/mochijson2.erl
@@ -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