[1/7] check_types_equal: short circuit check if identical pointers are used
Commit Message
From: Jeff Mahoney <jeffm@suse.com>
If two types share identical pointers, we don't need to check typedefs
before comparing the result.
---
gdb/gdbtypes.c | 3 +++
1 file changed, 3 insertions(+)
@@ -3218,6 +3218,9 @@ static int
check_types_equal (struct type *type1, struct type *type2,
VEC (type_equality_entry_d) **worklist)
{
+ if (type1 == type2)
+ return 1;
+
type1 = check_typedef (type1);
type2 = check_typedef (type2);