mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-12-16 12:23:50 +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:
@@ -190,15 +190,11 @@ class docParser(xml.sax.handler.ContentHandler):
|
|||||||
self.function_return_info,
|
self.function_return_info,
|
||||||
self.function_return_field]
|
self.function_return_field]
|
||||||
elif tag == 'info':
|
elif tag == 'info':
|
||||||
str = ''
|
str = ''.join(self._data)
|
||||||
for c in self._data:
|
|
||||||
str = str + c
|
|
||||||
if self.in_function == 1:
|
if self.in_function == 1:
|
||||||
self.function_descr = str
|
self.function_descr = str
|
||||||
elif tag == 'cond':
|
elif tag == 'cond':
|
||||||
str = ''
|
str = ''.join(self._data)
|
||||||
for c in self._data:
|
|
||||||
str = str + c
|
|
||||||
if self.in_function == 1:
|
if self.in_function == 1:
|
||||||
self.function_cond = str
|
self.function_cond = str
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user