incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: svn commit: r1066404 - /couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl
Date Wed, 02 Feb 2011 19:37:15 GMT
when is_list_of_lists?

On Wed, Feb 2, 2011 at 2:36 PM, Robert Newson <robert.newson@gmail.com> wrote:
> Ack, thanks. will fix (again)
>
> On Wed, Feb 2, 2011 at 7:17 PM, Filipe David Manana <fdmanana@apache.org> wrote:
>> 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