couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r811709 - in /couchdb/trunk/src/couchdb: couch_config.erl couch_httpd_auth.erl couch_rep.erl
Date Sat, 05 Sep 2009 20:37:45 GMT
Author: jan
Date: Sat Sep  5 20:37:45 2009
New Revision: 811709

URL: http://svn.apache.org/viewvc?rev=811709&view=rev
Log:
code =~ s/imperative/declarative & faster/, thanks to Kostis Sagonas for pointing these
out, more to come

Modified:
    couchdb/trunk/src/couchdb/couch_config.erl
    couchdb/trunk/src/couchdb/couch_httpd_auth.erl
    couchdb/trunk/src/couchdb/couch_rep.erl

Modified: couchdb/trunk/src/couchdb/couch_config.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_config.erl?rev=811709&r1=811708&r2=811709&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_config.erl (original)
+++ couchdb/trunk/src/couchdb/couch_config.erl Sat Sep  5 20:37:45 2009
@@ -94,8 +94,8 @@
         {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}}.

Modified: couchdb/trunk/src/couchdb/couch_httpd_auth.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_auth.erl?rev=811709&r1=811708&r2=811709&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_auth.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_auth.erl Sat Sep  5 20:37:45 2009
@@ -446,7 +446,7 @@
             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),

Modified: couchdb/trunk/src/couchdb/couch_rep.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=811709&r1=811708&r2=811709&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Sep  5 20:37:45 2009
@@ -268,7 +268,7 @@
         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) ->



Mime
View raw message