This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch rebase/access-2023
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 8de497c2a118fd316f112363db501283e467336f
Author: Jan Lehnardt <[email protected]>
AuthorDate: Sat Aug 20 13:09:29 2022 +0200

    fix: simplify
---
 src/couch/src/couch_db_updater.erl | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/couch/src/couch_db_updater.erl 
b/src/couch/src/couch_db_updater.erl
index d7b6a9fd0..cab27cc47 100644
--- a/src/couch/src/couch_db_updater.erl
+++ b/src/couch/src/couch_db_updater.erl
@@ -265,12 +265,7 @@ sort_and_tag_grouped_docs(Client, GroupedDocs) ->
     % The merge_updates function will fail and the database can end up with
     % duplicate documents if the incoming groups are not sorted, so as a sanity
     % check we sort them again here. See COUCHDB-2735.
-    Cmp = fun
-        % TODO: re-evaluate this addition, might be
-        %([], []) -> false;
-        %       superflous now
-        ([#doc{id = A} | _], [#doc{id = B} | _]) -> A < B
-    end,
+    Cmp = fun([#doc{id = A} | _], [#doc{id = B} | _]) -> A < B end,
     lists:map(
         fun(DocGroup) ->
             [{Client, maybe_tag_doc(D)} || D <- DocGroup]
@@ -784,7 +779,6 @@ update_docs_int(Db, DocsList, LocalDocs, ReplicatedChanges, 
UserCtx) ->
 
     {ok, commit_data(Db1), UpdatedDDocIds}.
 
-
 % at this point, we already validated this Db is access enabled, so do the 
checks right away.
 check_access(Db, UserCtx, Access) -> couch_db:check_access(Db#db{user_ctx = 
UserCtx}, Access).
 

Reply via email to