Repository: couchdb-couch Updated Branches: refs/heads/windsor-merge d39cb154b -> 386ab65a3
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/386ab65a Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/386ab65a Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/386ab65a Branch: refs/heads/windsor-merge Commit: 386ab65a36396ad74ca56bfff46d9a252362a046 Parents: d39cb15 Author: Paul J. Davis <[email protected]> Authored: Sun Aug 17 12:49:09 2014 -0500 Committer: Paul J. Davis <[email protected]> Committed: Sun Aug 17 12:49:09 2014 -0500 ---------------------------------------------------------------------- src/couch_ejson_compare.erl | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/386ab65a/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(_, []) ->
