incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: svn commit: r1066404 - /couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl
Date Wed, 02 Feb 2011 19:17:36 GMT
Robert,

> -        [User | Pass] ->
> +        [User | Pass] when is_list(Pass) ->
>             {User, string:join(Pass, ":")};
>         [User] ->
>             {User, ""};

"Pass" will always be a list. The clause with a single element match
is the redundant one. Calling string:join(":") on an emply list/string
will return an empty list/string, so the [User] clause could go away.

cheers

On Wed, Feb 2, 2011 at 2:26 AM,  <rnewson@apache.org> wrote:
> Author: rnewson
> Date: Wed Feb  2 10:26:43 2011
> New Revision: 1066404
>
> URL: http://svn.apache.org/viewvc?rev=1066404&view=rev
> Log:
> fix clause warning introduced with COUCHDB-969
>
> Modified:
>    couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl
>
> Modified: couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl
> URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl?rev=1066404&r1=1066403&r2=1066404&view=diff
> ==============================================================================
> --- couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl (original)
> +++ couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl Wed Feb  2 10:26:43 2011
> @@ -53,7 +53,7 @@ basic_name_pw(Req) ->
>             nil;
>         [User, Pass] ->
>             {User, Pass};
> -        [User | Pass] ->
> +        [User | Pass] when is_list(Pass) ->
>             {User, string:join(Pass, ":")};
>         [User] ->
>             {User, ""};
>
>
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message