couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1053731 - /couchdb/trunk/src/couchdb/couch_db_updater.erl
Date Wed, 29 Dec 2010 20:54:55 GMT
Author: fdmanana
Date: Wed Dec 29 20:54:55 2010
New Revision: 1053731

URL: http://svn.apache.org/viewvc?rev=1053731&view=rev
Log:
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/trunk/src/couchdb/couch_db_updater.erl

Modified: couchdb/trunk/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_updater.erl?rev=1053731&r1=1053730&r2=1053731&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_updater.erl Wed Dec 29 20:54:55 2010
@@ -618,16 +618,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),



Mime
View raw message