summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/couchdb/couch_config.erl4
-rw-r--r--src/couchdb/couch_httpd_auth.erl2
-rw-r--r--src/couchdb/couch_rep.erl2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/couchdb/couch_config.erl b/src/couchdb/couch_config.erl
index 1e9ae41f..69d0ac93 100644
--- a/src/couchdb/couch_config.erl
+++ b/src/couchdb/couch_config.erl
@@ -94,8 +94,8 @@ init(IniFiles) ->
{ok, ParsedIniValues} = parse_ini_file(IniFile),
ets:insert(?MODULE, ParsedIniValues)
end, IniFiles),
- WriteFile = case length(IniFiles) > 0 of
- true -> lists:last(IniFiles);
+ WriteFile = case IniFiles of
+ [_|_] -> lists:last(IniFiles);
_ -> undefined
end,
{ok, #config{write_filename=WriteFile}}.
diff --git a/src/couchdb/couch_httpd_auth.erl b/src/couchdb/couch_httpd_auth.erl
index e7a2e3a1..522c0266 100644
--- a/src/couchdb/couch_httpd_auth.erl
+++ b/src/couchdb/couch_httpd_auth.erl
@@ -446,7 +446,7 @@ update_user_req(#httpd{method='PUT', mochi_req=MochiReq, user_ctx=UserCtx}=Req,
Hash = case Password of
<<>> ->
CurrentPasswordHash;
- _P when length(OldPassword) == 0 ->
+ _P when OldPassword = [] ->
throw({forbidden, <<"Old password is incorrect.">>});
_Else ->
OldPasswordHash = hash_password(OldPassword1, UserSalt),
diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl
index 1411716f..b1c46db9 100644
--- a/src/couchdb/couch_rep.erl
+++ b/src/couchdb/couch_rep.erl
@@ -268,7 +268,7 @@ compare_replication_logs(SrcDoc, TgtDoc) ->
compare_rep_history(SourceHistory, TargetHistory)
end.
-compare_rep_history(S, T) when length(S) =:= 0 orelse length(T) =:= 0 ->
+compare_rep_history([], []) ->
?LOG_INFO("no common ancestry -- performing full replication", []),
{0, []};
compare_rep_history([{S}|SourceRest], [{T}|TargetRest]=Target) ->