]> sourceware.org Git - libabigail.git/commitdiff
[abixml writer] Use an unordered set when appropriate
authorDodji Seketeli <dodji@redhat.com>
Wed, 4 Oct 2017 12:18:55 +0000 (14:18 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 4 Oct 2017 12:22:37 +0000 (14:22 +0200)
* src/abg-writer.cc (write_context::m_emitted_decl_only_set):
Renamed m_emitted_decl_only_map into this and make the type be a
set, rather than a map.
(write_context::{record_decl_only_type_as_emitted,
decl_only_type_is_emitted}): Adjust.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-writer.cc

index 2e91be4faeee7953590f3cbb55eeaa59284984b9..0bb408fe6d297ca55579bd2fc0b0663949e2721a 100644 (file)
@@ -165,8 +165,8 @@ class write_context
   ostream&                             m_ostream;
   bool                                 m_annotate;
   mutable type_ptr_map                 m_type_id_map;
-  type_ptr_map                         m_emitted_decl_only_map;
   mutable type_ptr_set_type            m_emitted_type_set;
+  type_ptr_set_type                    m_emitted_decl_only_set;
   // A map of types that are referenced by emitted pointers,
   // references or typedefs
   type_ptr_map                         m_referenced_types_map;
@@ -543,7 +543,7 @@ public:
   {
     class_or_union* cl = is_class_or_union_type(t);
     assert(cl && cl->get_is_declaration_only());
-    m_emitted_decl_only_map[t] = interned_string();
+    m_emitted_decl_only_set.insert(t);
   }
 
   /// Record a declaration-only class as being emitted.
@@ -565,8 +565,8 @@ public:
   bool
   decl_only_type_is_emitted(type_base* t)
   {
-    type_ptr_map::const_iterator i = m_emitted_decl_only_map.find(t);
-    if (i == m_emitted_decl_only_map.end())
+    type_ptr_set_type::const_iterator i = m_emitted_decl_only_set.find(t);
+    if (i == m_emitted_decl_only_set.end())
       return false;
     return true;
   }
This page took 0.040739 seconds and 5 git commands to generate.