mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 06:00:08 +01: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') (cherry picked from commitdd595c6c1d)
This commit is contained in:
parent
3ce3a93200
commit
8edf13d0b4
1 changed files with 1 additions and 4 deletions
|
|
@ -114,10 +114,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…
Add table
Reference in a new issue