couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [34/48] mem3 commit: updated refs/heads/windsor-merge to ff02b9a
Date Fri, 01 Aug 2014 09:11:20 GMT
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/windsor-merge
Commit: 36a1e63ad120dc1c3d1382119395aee42b555100
Parents: fcbc821
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Fri Dec 6 11:59:45 2013 -0600
Committer: Robert Newson <rnewson@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,


Mime
View raw message