You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/08/06 15:25:26 UTC

[GitHub] [couchdb] davisp commented on a change in pull request #3062: Prototype/fdb layer ebtree enhance

davisp commented on a change in pull request #3062:
URL: https://github.com/apache/couchdb/pull/3062#discussion_r466493495



##########
File path: src/ebtree/src/ebtree.erl
##########
@@ -940,9 +941,9 @@ collate(#tree{} = Tree, A, B, Allowed) ->
     lists:member(collate(Tree, A, B), Allowed).
 
 
-umerge_members(#tree{} = Tree, List1, List2) ->
+umerge_members(#tree{} = Tree, Level, List1, List2) ->
     CollateWrapper = fun
-        ({K1, _V1}, {K2, _V2}) ->
+        ({K1, _V1}, {K2, _V2}) when Level == 0 ->
             collate(Tree, K1, K2, [lt, eq]);
         ({_F1, L1, _V1, _R1}, {_F2, L2, _V2, _R2}) ->

Review comment:
       Seems like you might as well add a `when Level > 0` guard here?

##########
File path: src/ebtree/src/ebtree.erl
##########
@@ -940,9 +941,9 @@ collate(#tree{} = Tree, A, B, Allowed) ->
     lists:member(collate(Tree, A, B), Allowed).
 
 
-umerge_members(#tree{} = Tree, List1, List2) ->
+umerge_members(#tree{} = Tree, Level, List1, List2) ->
     CollateWrapper = fun
-        ({K1, _V1}, {K2, _V2}) ->
+        ({K1, _V1}, {K2, _V2}) when Level == 0 ->
             collate(Tree, K1, K2, [lt, eq]);
         ({_F1, L1, _V1, _R1}, {_F2, L2, _V2, _R2}) ->

Review comment:
       And in the corresponding places below.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org