diff options
author | Matthias Maennich <maennich@google.com> | 2021-12-03 11:46:21 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@redhat.com> | 2022-01-18 18:13:38 +0100 |
commit | 4565679f3d081f8b4b5598012c2d9ccb992de59b (patch) | |
tree | 9dab8eef8f201585d84f1e4b322dbfe9af0bab84 | |
parent | abidiff: include ABI XML versions when reporting a mismatch cont. (diff) | |
download | libabigail-4565679f3d081f8b4b5598012c2d9ccb992de59b.tar.gz libabigail-4565679f3d081f8b4b5598012c2d9ccb992de59b.tar.bz2 libabigail-4565679f3d081f8b4b5598012c2d9ccb992de59b.tar.xz |
XML writer: track emitted types by bare pointer
This is a performance and safety improvement made possible by the
previous changes which ensure that the same pointers are inserted and
looked up.
This essentially removes the now unnecessary deep comparison.
* src/abg-writer.cc (type_ptr_set_type): Change typedef
container type to use default equality and hashing for pointer
keys.
(fn_type_ptr_set_type): Likewise.
Reviewed-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
-rw-r--r-- | src/abg-writer.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 76ce809b..df0e17a3 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc | |||
@@ -124,14 +124,10 @@ typedef unordered_map<type_base*, | |||
124 | abigail::diff_utils::deep_ptr_eq_functor> type_ptr_map; | 124 | abigail::diff_utils::deep_ptr_eq_functor> type_ptr_map; |
125 | 125 | ||
126 | // A convenience typedef for a set of type_base*. | 126 | // A convenience typedef for a set of type_base*. |
127 | typedef unordered_set<const type_base*, type_hasher, | 127 | typedef std::unordered_set<const type_base*> type_ptr_set_type; |
128 | abigail::diff_utils::deep_ptr_eq_functor> | ||
129 | type_ptr_set_type; | ||
130 | 128 | ||
131 | /// A convenience typedef for a set of function type*. | 129 | /// A convenience typedef for a set of function type*. |
132 | typedef unordered_set<function_type*, type_hasher, | 130 | typedef std::unordered_set<function_type*> fn_type_ptr_set_type; |
133 | abigail::diff_utils::deep_ptr_eq_functor> | ||
134 | fn_type_ptr_set_type; | ||
135 | 131 | ||
136 | typedef unordered_map<shared_ptr<function_tdecl>, | 132 | typedef unordered_map<shared_ptr<function_tdecl>, |
137 | string, | 133 | string, |