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:22:49 UTC

[29/50] mem3 commit: updated refs/heads/master to 64c0c74

Inline open_doc_revs into open_docs

This function was trivial and never reused. It was more confusing to
have it as a separate function rather than just inlining into where it's
used.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/36a1e63a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/36a1e63a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/36a1e63a

Branch: refs/heads/master
Commit: 36a1e63ad120dc1c3d1382119395aee42b555100
Parents: fcbc821
Author: Paul J. Davis <pa...@gmail.com>
Authored: Fri Dec 6 11:59:45 2013 -0600
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 23 18:46:27 2014 +0100

----------------------------------------------------------------------
 src/mem3_rep.erl | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/36a1e63a/src/mem3_rep.erl
----------------------------------------------------------------------
diff --git a/src/mem3_rep.erl b/src/mem3_rep.erl
index d01eaf3..4284518 100644
--- a/src/mem3_rep.erl
+++ b/src/mem3_rep.erl
@@ -204,17 +204,14 @@ save_on_target(Node, Name, Docs) ->
 open_docs(#acc{source=Source, infos=Infos}, Missing) ->
     lists:flatmap(fun({Id, Revs, _}) ->
         FDI = lists:keyfind(Id, #full_doc_info.id, Infos),
-        open_doc_revs(Source, FDI, Revs)
+        RevTree = FDI#full_doc_info.rev_tree,
+        {FoundRevs, _} = couch_key_tree:get_key_leafs(RevTree, Revs),
+        lists:map(fun({#leaf{deleted=IsDel, ptr=SummaryPtr}, FoundRevPath}) ->
+            couch_db:make_doc(Source, Id, IsDel, SummaryPtr, FoundRevPath)
+        end, FoundRevs)
     end, Missing).
 
 
-open_doc_revs(Db, #full_doc_info{id=Id, rev_tree=RevTree}, Revs) ->
-    {FoundRevs, _} = couch_key_tree:get_key_leafs(RevTree, Revs),
-    lists:map(fun({#leaf{deleted=IsDel, ptr=SummaryPtr}, FoundRevPath}) ->
-                  couch_db:make_doc(Db, Id, IsDel, SummaryPtr, FoundRevPath)
-    end, FoundRevs).
-
-
 update_locals(Acc) ->
     #acc{seq=Seq, source=Db, target=Target, localid=Id} = Acc,
     #shard{name=Name, node=Node} = Target,