You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Filipe David Manana <fd...@apache.org> on 2011/02/02 20:17:36 UTC
Re: svn commit: r1066404 - /couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl
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, <rn...@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."
Re: svn commit: r1066404 - /couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl
Posted by Filipe David Manana <fd...@apache.org>.
On Wed, Feb 2, 2011 at 11:37 AM, Paul Davis <pa...@gmail.com> wrote:
> when is_list_of_lists?
Right
In fact the clause [User, Pass] can also go away. Just having
[User | PassParts] -> {User, string:join(PassPartss, ":")}
should do it
>
> On Wed, Feb 2, 2011 at 2:36 PM, Robert Newson <ro...@gmail.com> wrote:
>> Ack, thanks. will fix (again)
>>
>> On Wed, Feb 2, 2011 at 7:17 PM, Filipe David Manana <fd...@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, <rn...@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."
>>>
>>
>
--
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."
Re: svn commit: r1066404 - /couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl
Posted by Paul Davis <pa...@gmail.com>.
when is_list_of_lists?
On Wed, Feb 2, 2011 at 2:36 PM, Robert Newson <ro...@gmail.com> wrote:
> Ack, thanks. will fix (again)
>
> On Wed, Feb 2, 2011 at 7:17 PM, Filipe David Manana <fd...@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, <rn...@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."
>>
>
Re: svn commit: r1066404 - /couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl
Posted by Robert Newson <ro...@gmail.com>.
Ack, thanks. will fix (again)
On Wed, Feb 2, 2011 at 7:17 PM, Filipe David Manana <fd...@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, <rn...@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."
>