summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2011-01-17 11:43:37 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2011-01-17 11:43:37 +0000
commit18d16e55265d5017331d5b40726e3defed949e06 (patch)
treecb9c55f33caa8755ba6d7d48a8b7443870e582ad
parente205011324717150cb5bd9e0cd9aa334071ab5ad (diff)
Merged revision 1053731 from trunk
Two cleanups in couch_db_updater It also seems to add a little performance gain: http://graphs.mikeal.couchone.com/#/graph/8bf31813eef7c0b7e37d1ea259020a0 Closes COUCHDB-1000 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1059892 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/couchdb/couch_db_updater.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/couchdb/couch_db_updater.erl b/src/couchdb/couch_db_updater.erl
index e660800d..bac31a8e 100644
--- a/src/couchdb/couch_db_updater.erl
+++ b/src/couchdb/couch_db_updater.erl
@@ -623,16 +623,19 @@ update_docs_int(Db, DocsList, NonRepDocs, MergeConflicts, FullCommit) ->
% Check if we just updated any design documents, and update the validation
% funs if we did.
- case [1 || <<"_design/",_/binary>> <- Ids] of
- [] ->
+ case lists:any(
+ fun(<<"_design/", _/binary>>) -> true; (_) -> false end, Ids) of
+ false ->
Db4 = Db3;
- _ ->
+ true ->
Db4 = refresh_validate_doc_funs(Db3)
end,
{ok, commit_data(Db4, not FullCommit)}.
+update_local_docs(Db, []) ->
+ {ok, Db};
update_local_docs(#db{local_docs_btree=Btree}=Db, Docs) ->
Ids = [Id || {_Client, #doc{id=Id}} <- Docs],
OldDocLookups = couch_btree:lookup(Btree, Ids),