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

Frediano Ziglio fziglio at redhat.com
Sun Aug 11 09:42:53 UTC 2019


> 
> 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 at redhat.com>

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


More information about the Spice-devel mailing list