This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Don't copy a set
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Rafael EspÃndola <rafael dot espindola at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at google dot com>
- Date: Thu, 2 Apr 2015 15:59:23 -0700
- Subject: Re: [patch] Don't copy a set
- Authentication-results: sourceware.org; auth=none
- References: <CAG3jReJyat1fDvt9vXhSOoTxnS=NMAsKOFqj0Ot9va4XtT6QRQ at mail dot gmail dot com>
> This just avoids calling a copy constructor.
- 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();
Hmmm, I seem to remember fixing this, or something very much like
this, before. This is OK, with a ChangeLog entry. Thanks!
-cary