From: Rafael Ávila de Espíndola Date: Mon, 6 Apr 2015 19:39:42 +0000 (-0400) Subject: Avoid a copy constructor call. X-Git-Tag: gdb-7.10-release~921 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dbb4b021df7015ab7a7dee40e30f72470afde6b;p=external%2Fbinutils.git Avoid a copy constructor call. --- 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 + + * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy + constructor call. + 2015-04-06 Ilya Tocar 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) {