This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Don't copy a set


This just avoids calling a copy constructor.

Chromium link times go from 6.340187105 ( +- 0.60% ) to 6.214002610 (
+- 0.28% ) seconds.

Cheers,
Rafael
diff --git a/gold/gc.cc b/gold/gc.cc
index 843b2b8..95867c4 100644
--- a/gold/gc.cc
+++ b/gold/gc.cc
@@ -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)
         {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]