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

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



On 08/21/2013 08:05 AM, Claudio Bley wrote:
> 
> 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(-)

ACK.

> 
> 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")
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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