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

Uri Lublin uril at redhat.com
Sun Aug 11 09:26:04 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>
---
 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)
-- 
2.21.0



More information about the Spice-devel mailing list