Re: [spice-common PATCH 1/2] ptypes.py: remove useless condition member != None

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> member = None is set before the if/else condition.
> In the else code, when member is set it is checked
> and if not-None it breaks out of the loop.
> If the code is still in the loop for sure member is None.
> 
> Found by covscan.
> 
> Signed-off-by: Uri Lublin <uril@xxxxxxxxxx>

Acked

> ---
>  python_modules/ptypes.py | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
> index b08170e..311ce3d 100644
> --- a/python_modules/ptypes.py
> +++ b/python_modules/ptypes.py
> @@ -884,8 +884,6 @@ class ContainerType(Type):
>                      member = m.lookup_case_member(name)
>                      if member != None:
>                          break
> -                if member != None:
> -                    break
>  
>          if member == None:
>              raise Exception("No member called %s found" % name)

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]