You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/01/17 12:43:37 UTC
svn commit: r1059892 -
/couchdb/branches/1.1.x/src/couchdb/couch_db_updater.erl
Author: fdmanana
Date: Mon Jan 17 11:43:37 2011
New Revision: 1059892
URL: http://svn.apache.org/viewvc?rev=1059892&view=rev
Log:
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
Modified:
couchdb/branches/1.1.x/src/couchdb/couch_db_updater.erl
Modified: couchdb/branches/1.1.x/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_db_updater.erl?rev=1059892&r1=1059891&r2=1059892&view=diff
==============================================================================
--- couchdb/branches/1.1.x/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/branches/1.1.x/src/couchdb/couch_db_updater.erl Mon Jan 17 11:43:37 2011
@@ -623,16 +623,19 @@ update_docs_int(Db, DocsList, NonRepDocs
% 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),