[issue2170] rewrite of minidom.Node.normalize

Malte Helmert report at bugs.python.org
Tue Mar 17 23:58:36 CET 2009


Malte Helmert <helmert at informatik.uni-freiburg.de> added the comment:

While we're cleaning up:
       data = child.data
       if not data:
could be
       if not child.data:
since data is not used again.

Alternatively, you could use data in place of child.data later on for a
small speed-up, but I doubt that we care about such small optimizations
here. If we do, then we should also assign a name to child.nextSibling,
though.

I found the three-line duplication between the two branches mildly
refactor-worthy, but when I eliminated it the control logic got more
involved and I don't think that's a good trade-off here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2170>
_______________________________________


More information about the Python-bugs-list mailing list