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

[libvirt] [PATCH] python: simplify complicated conditional assignment



Signed-off-by: Claudio Bley <cbley av-test de>
---
Just noticed this while reading the generated .py files.

Might save a few cycles eventually...

 python/generator.py |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/python/generator.py b/python/generator.py
index 427cebc..10390c3 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -1455,8 +1455,7 @@ def buildWrappers(module):
                 elif classname in [ "virDomainSnapshot" ]:
                     classes.write("        self._dom = dom\n")
                     classes.write("        self._conn = dom.connect()\n")
-                classes.write("        if _obj != None:self._o = _obj;return\n")
-                classes.write("        self._o = None\n\n")
+                classes.write("        self._o = _obj\n\n")
             destruct=None
             if classes_destructors.has_key(classname):
                 classes.write("    def __del__(self):\n")
-- 
1.7.9.5


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