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


The following commit(s) were added to refs/heads/rebase/access-2023 by this 
push:
     new 547d93a56 refactor: resolve layer boundary violation
547d93a56 is described below

commit 547d93a566a50909a6a91dd83ce5b92a3759dfe3
Author: Jan Lehnardt <[email protected]>
AuthorDate: Sat Jul 8 15:37:07 2023 +0200

    refactor: resolve layer boundary violation
---
 src/couch/src/couch_btree.erl              | 9 +--------
 src/couch_mrview/src/couch_mrview_util.erl | 3 ++-
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/couch/src/couch_btree.erl b/src/couch/src/couch_btree.erl
index b908421f2..7a8c47d71 100644
--- a/src/couch/src/couch_btree.erl
+++ b/src/couch/src/couch_btree.erl
@@ -110,17 +110,10 @@ full_reduce(#btree{root = nil, reduce = Reduce}) ->
 full_reduce(#btree{root = Root}) ->
     {ok, element(2, Root)}.
 
-full_reduce_with_options(Bt, Options0) ->
+full_reduce_with_options(Bt, Options) ->
     CountFun = fun(_SeqStart, PartialReds, 0) ->
         {ok, couch_btree:final_reduce(Bt, PartialReds)}
     end,
-    [UserName] = proplists:get_value(start_key, Options0, <<"">>),
-    EndKey = {[UserName, {[]}]},
-    Options =
-        Options0 ++
-            [
-                {end_key, EndKey}
-            ],
     fold_reduce(Bt, CountFun, 0, Options).
 
 size(#btree{root = nil}) ->
diff --git a/src/couch_mrview/src/couch_mrview_util.erl 
b/src/couch_mrview/src/couch_mrview_util.erl
index 95d49fa4a..1795dba35 100644
--- a/src/couch_mrview/src/couch_mrview_util.erl
+++ b/src/couch_mrview/src/couch_mrview_util.erl
@@ -440,7 +440,8 @@ reduce_to_count(Reductions) ->
 
 get_access_row_count(#mrview{btree = Bt}, UserName) ->
     couch_btree:full_reduce_with_options(Bt, [
-        {start_key, UserName}
+        {start_key, UserName},
+        {end_key, {[UserName, {[]}]}} % is this correct? should this not be 
\ufff0?
     ]).
 
 fold(#mrview{btree = Bt}, Fun, Acc, Opts) ->

Reply via email to