Refactor an if: else: clause as elif stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 20 Feb 2012 11:07:39 +0100
branchstable
changeset 686 9a61c1d4c3db
parent 685 dd39f2652127
child 687 2a532f897388
Refactor an if: else: clause as elif
analyze.py
--- a/analyze.py	Mon Feb 20 11:07:36 2012 +0100
+++ b/analyze.py	Mon Feb 20 11:07:39 2012 +0100
@@ -347,10 +347,9 @@
         func = getattr(self, 'visit_%s' % node.__class__.__name__.lower())
         if constraints is None:
             func(node)
-        else:
-            if func(node, constraints) is None:
-                for c in node.children:
-                    self._visit(c, constraints)
+        elif func(node, constraints) is None:
+            for c in node.children:
+                self._visit(c, constraints)
 
     def _uid_node_types(self, valnode):
         types = set()