[glib/wip/otte/interface-types] Simplify g_type_interface_instantiable_prerequisite
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/otte/interface-types] Simplify g_type_interface_instantiable_prerequisite
- Date: Mon, 26 Oct 2020 19:45:37 +0000 (UTC)
commit d485a3549590e6b6cbc512906bff7ea4ce4967d5
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 26 15:43:03 2020 -0400
Simplify g_type_interface_instantiable_prerequisite
Interfaces can have at most one instantiable prerequisite,
so once we found an instantiable type in the list of
prerequisites, we are done, no need for further checks.
This removes the branches that coverage testing was
complaining about.
gobject/gtype.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gobject/gtype.c b/gobject/gtype.c
index e6e7e7165..69e4e9fbd 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -1725,8 +1725,8 @@ g_type_interface_instantiable_prerequisite (GType interface_type)
TypeNode *node = lookup_type_node_I (prerequisite);
if (node->is_instantiatable)
{
- if (!inode || type_node_is_a_L (node, inode))
- inode = node;
+ inode = node;
+ break;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]