Simplify Garbage_collection::add_reference a bit.
authorRafael Ávila de Espíndola <rafael.espindola@gmail.com>
Tue, 17 Feb 2015 15:49:41 +0000 (10:49 -0500)
committerRafael Ávila de Espíndola <rafael.espindola@gmail.com>
Tue, 17 Feb 2015 15:49:41 +0000 (10:49 -0500)
this->section_reloc_map_[src_id] is created if it doesn't exist, so there
is no point in doing a find.

gold/ChangeLog
gold/gc.h

index 5a72e986ef77d4d6ce5fbc37f35ce6e42da83b86..56696350830b33f384c6923bf1bc4bda0f40f698 100644 (file)
@@ -1,3 +1,7 @@
+2015-02-17  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
+
+       * gc.h (Garbage_collection::add_reference): Don't use find.
+
 2015-02-17  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
 
        * object.cc (write_local_symbols): avoid std::vector copy.
index 2db7cb909b052891f8edb0ecad8cde0f54d40bc2..be4a63c5c22c2f6ac5fc8106939b0f2af7e51e47 100644 (file)
--- a/gold/gc.h
+++ b/gold/gc.h
@@ -109,11 +109,8 @@ class Garbage_collection
   {
     Section_id src_id(src_object, src_shndx);
     Section_id dst_id(dst_object, dst_shndx);
-    Section_ref::iterator p = this->section_reloc_map_.find(src_id);
-    if (p == this->section_reloc_map_.end())
-      this->section_reloc_map_[src_id].insert(dst_id);
-    else
-      p->second.insert(dst_id);
+    Sections_reachable& reachable = this->section_reloc_map_[src_id];
+    reachable.insert(dst_id);
   }
 
  private:
This page took 0.033414 seconds and 4 git commands to generate.