couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1034380 - in /couchdb/trunk/src/couchdb: couch_auth_cache.erl couch_query_servers.erl
Date Fri, 12 Nov 2010 12:44:51 GMT
Author: fdmanana
Date: Fri Nov 12 12:44:51 2010
New Revision: 1034380

URL: http://svn.apache.org/viewvc?rev=1034380&view=rev
Log:
Use lists:min/1 and lists:max/1 instead of erlang:min/2 and erlang:max/2. The later are not
available in earlier OTP releases.
Closes COUCHDB-856.


Modified:
    couchdb/trunk/src/couchdb/couch_auth_cache.erl
    couchdb/trunk/src/couchdb/couch_query_servers.erl

Modified: couchdb/trunk/src/couchdb/couch_auth_cache.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_auth_cache.erl?rev=1034380&r1=1034379&r2=1034380&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_auth_cache.erl (original)
+++ couchdb/trunk/src/couchdb/couch_auth_cache.erl Fri Nov 12 12:44:51 2010
@@ -175,7 +175,7 @@ handle_call({new_max_cache_size, NewSize
     end,
     NewState = State#state{
         max_cache_size = NewSize,
-        cache_size = erlang:min(NewSize, State#state.cache_size)
+        cache_size = lists:min([NewSize, State#state.cache_size])
     },
     {reply, ok, NewState};
 

Modified: couchdb/trunk/src/couchdb/couch_query_servers.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_query_servers.erl?rev=1034380&r1=1034379&r2=1034380&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_query_servers.erl (original)
+++ couchdb/trunk/src/couchdb/couch_query_servers.erl Fri Nov 12 12:44:51 2010
@@ -195,7 +195,7 @@ sum_terms(_, _) ->
 
 builtin_stats(reduce, [[_,First]|Rest]) when is_number(First) ->
     Stats = lists:foldl(fun([_K,V], {S,C,Mi,Ma,Sq}) when is_number(V) ->
-        {S+V, C+1, erlang:min(Mi,V), erlang:max(Ma,V), Sq+(V*V)};
+        {S+V, C+1, lists:min([Mi, V]), lists:max([Ma, V]), Sq+(V*V)};
     (_, _) ->
         throw({invalid_value,
             <<"builtin _stats function requires map values to be numbers">>})
@@ -207,7 +207,7 @@ builtin_stats(rereduce, [[_,First]|Rest]
     {[{sum,Sum0}, {count,Cnt0}, {min,Min0}, {max,Max0}, {sumsqr,Sqr0}]} = First,
     Stats = lists:foldl(fun([_K,Red], {S,C,Mi,Ma,Sq}) ->
         {[{sum,Sum}, {count,Cnt}, {min,Min}, {max,Max}, {sumsqr,Sqr}]} = Red,
-        {Sum+S, Cnt+C, erlang:min(Min,Mi), erlang:max(Max,Ma), Sqr+Sq}
+        {Sum+S, Cnt+C, lists:min([Min, Mi]), lists:max([Max, Ma]), Sqr+Sq}
     end, {Sum0,Cnt0,Min0,Max0,Sqr0}, Rest),
     {Sum, Cnt, Min, Max, Sqr} = Stats,
     {[{sum,Sum}, {count,Cnt}, {min,Min}, {max,Max}, {sumsqr,Sqr}]}.



Mime
View raw message