Having two branches in the same if structure with
the same implementation is at best duplicate code,
and at worst a coding error.If the same logic is truly
needed for both instances, then they should be combined.
Signed-off-by: dinglimin <dinglimin@cmss.chinamobile.com>
---
v1 of:
https://www.mail-archive.com/libvir-list@redhat.com/msg232231.html
diff to v1:
- Add the patch 's description.
- Change the code format.
---
scripts/apibuild.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/scripts/apibuild.py b/scripts/apibuild.py
index c232b4e2c8..140916ec4c 100755
--- a/scripts/apibuild.py
+++ b/scripts/apibuild.py
@@ -1248,10 +1248,8 @@ class CParser:
token[1] == "," or token[1] == "="):
self.index_add_ref(oldtok[1], self.filename,
0, "type")
- elif oldtok[0] == "name" and oldtok[1][0:4] == "XEN_":
- self.index_add_ref(oldtok[1], self.filename,
- 0, "typedef")
- elif oldtok[0] == "name" and oldtok[1][0:7] == "LIBXEN_":
+ elif oldtok[0] == "name" and (oldtok[1][0:4] == "XEN_" or
+ oldtok[1][0:7] == "LIBXEN_"):
self.index_add_ref(oldtok[1], self.filename,
0, "typedef")
--
2.18.4