You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/28 14:12:11 UTC

[35/50] couch commit: updated refs/heads/master to 9d0ac7d

Fix couch_ejson_compare:less/2 for complex values

The equality comparisons in the functions used by couch_ejson_compare:less/2
were never updated to return 0 for equal values as they were always
assuming to return pure ordering information. This fixes the missing
cases for both arrays and objects.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/0355465d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/0355465d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/0355465d

Branch: refs/heads/master
Commit: 0355465d9dc7e116bf8b4f386b1dac15c29fd6e0
Parents: 458b80a
Author: Paul J. Davis <pa...@gmail.com>
Authored: Sun Aug 17 12:49:09 2014 -0500
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 28 13:00:02 2014 +0100

----------------------------------------------------------------------
 src/couch_ejson_compare.erl | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0355465d/src/couch_ejson_compare.erl
----------------------------------------------------------------------
diff --git a/src/couch_ejson_compare.erl b/src/couch_ejson_compare.erl
index a1c5b21..81adbb8 100644
--- a/src/couch_ejson_compare.erl
+++ b/src/couch_ejson_compare.erl
@@ -73,6 +73,8 @@ atom_sort(null) -> 1;
 atom_sort(false) -> 2;
 atom_sort(true) -> 3.
 
+less_props([], []) ->
+    0;
 less_props([], [_|_]) ->
     -1;
 less_props(_, []) ->
@@ -90,6 +92,8 @@ less_props([{AKey, AValue}|RestA], [{BKey, BValue}|RestB]) ->
         Result
     end.
 
+less_list([], []) ->
+    0;
 less_list([], [_|_]) ->
     -1;
 less_list(_, []) ->