mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 10:14:41 +00:00
tools: fix bogus code in "tools/generate-docs-nm-property-infos.py"
Coverity warns about this:
2. NetworkManager-1.32.2/tools/generate-docs-nm-property-infos.py:117: identical_branches:
The same code is executed regardless of whether "temp.index(subelement) < len(temp) - 1" is
true, because the then and else branches are identical. Should one of the branches be modified,
or the entire 'if' statement replaced?
Fixes: c3504f7e62
('Rewrite `./tools/generate-docs-nm-property-infos.py` with XML library')
This commit is contained in:
parent
c6be3404f8
commit
dd595c6c1d
|
@ -128,10 +128,7 @@ def pretty_xml(element, newline, level=0):
|
|||
element.text = newline + element.text.strip() + newline
|
||||
temp = list(element)
|
||||
for subelement in temp:
|
||||
if temp.index(subelement) < (len(temp) - 1):
|
||||
subelement.tail = newline
|
||||
else:
|
||||
subelement.tail = newline
|
||||
subelement.tail = newline
|
||||
pretty_xml(subelement, newline, level=level + 1)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue