1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-15 08:23:48 +03:00

generator: Simplify string concatentaion

by using ''.join() instead of concatenating string fragments in a loop,
which is slower as it required re-hashing the string multiple times.

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn
2018-11-20 10:16:20 +01:00
committed by Jano Tomko
parent 879dae7483
commit 4b798e3405

View File

@@ -190,15 +190,11 @@ class docParser(xml.sax.handler.ContentHandler):
self.function_return_info,
self.function_return_field]
elif tag == 'info':
str = ''
for c in self._data:
str = str + c
str = ''.join(self._data)
if self.in_function == 1:
self.function_descr = str
elif tag == 'cond':
str = ''
for c in self._data:
str = str + c
str = ''.join(self._data)
if self.in_function == 1:
self.function_cond = str