This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Avoid a copy constructor call.
- From: Rafael "थvila" de "Espथऐndola" <espindola at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 6 Apr 2015 19:40:33 -0000
- Subject: [binutils-gdb] Avoid a copy constructor call.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9dbb4b021df7015ab7a7dee40e30f72470afde6b
commit 9dbb4b021df7015ab7a7dee40e30f72470afde6b
Author: Rafael Ã?vila de EspÃndola <rafael.espindola@gmail.com>
Date: Mon Apr 6 15:39:42 2015 -0400
Avoid a copy constructor call.
Diff:
---
gold/ChangeLog | 5 +++++
gold/gc.cc | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index a838b05..9eadf3b 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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
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)
{