This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] Don't copy a set
- From: Rafael EspÃndola <rafael dot espindola at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Cary Coutant <ccoutant at google dot com>
- Date: Wed, 1 Apr 2015 14:45:14 -0400
- Subject: [patch] Don't copy a set
- Authentication-results: sourceware.org; auth=none
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)
{