Avoid a copy constructor call.
authorRafael Ávila de Espíndola <rafael.espindola@gmail.com>
Mon, 6 Apr 2015 19:39:42 +0000 (15:39 -0400)
committerRafael Ávila de Espíndola <rafael.espindola@gmail.com>
Mon, 6 Apr 2015 19:39:42 +0000 (15:39 -0400)
gold/ChangeLog
gold/gc.cc

index a838b05ae5a0e9e9b8f11cfa0912d939d41c2d56..9eadf3b7cc92b9bccca511f1e000cd3db3c4b088 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-06  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
+
+       * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
+       constructor call.
+
 2015-04-06  Ilya Tocar  <ilya.tocar@intel.com>
 
        PR gold/17641
index 843b2b801e74e8fb7299675746ca19309f810626..95867c4bbb6ef4c912b9c5af7698e90a8660b8b0 100644 (file)
@@ -53,9 +53,10 @@ Garbage_collection::do_transitive_closure()
                 this->section_reloc_map().find(entry);
       if (find_it == this->section_reloc_map().end()) 
           continue;
-      Garbage_collection::Sections_reachable v = find_it->second;
+      const Garbage_collection::Sections_reachable &v = find_it->second;
       // Scan the vector of references for each work_list entry. 
-      for (Garbage_collection::Sections_reachable::iterator it_v = v.begin();
+      for (Garbage_collection::Sections_reachable::const_iterator it_v =
+               v.begin();
            it_v != v.end();
            ++it_v)
         {
This page took 0.034293 seconds and 4 git commands to generate.