summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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),