Code review comment for lp:~wgrant/launchpad/bug-629921-packages-empty-filter

Revision history for this message
Robert Collins (lifeless) wrote :

On Sat, Oct 2, 2010 at 8:19 PM, William Grant <email address hidden> wrote:
>
> -        if requested_name_filter is not None:
> +        if (requested_name_filter is not None and
> +            len(requested_name_filter[0]) > 0):
>             return requested_name_filter[0]

I would write this as
'if requested_name_filter and requested_name_filter[0]:'

Its more correct (if requested_name_filter[0] = None, your code will crash).

Looks good otherwise.

-Rob

« Back to merge proposal