From 18d16e55265d5017331d5b40726e3defed949e06 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Mon, 17 Jan 2011 11:43:37 +0000 Subject: 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 --- src/couchdb/couch_db_updater.erl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/couchdb/couch_db_updater.erl') 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), -- cgit v1.2.3