diff options
author | Rafael Ávila de Espíndola <rafael.espindola@gmail.com> | 2015-04-06 15:45:37 -0400 |
---|---|---|
committer | Rafael Ávila de Espíndola <rafael.espindola@gmail.com> | 2015-04-06 15:46:30 -0400 |
commit | 5368dcf2bae8f15e16cd14348bb7bd716bbc81cb (patch) | |
tree | 4953ccfb218e597677df1029bae7f5613beedea5 /gold/gc.cc | |
parent | 9dbb4b021df7015ab7a7dee40e30f72470afde6b (diff) | |
download | binutils-5368dcf2bae8f15e16cd14348bb7bd716bbc81cb.zip binutils-5368dcf2bae8f15e16cd14348bb7bd716bbc81cb.tar.gz binutils-5368dcf2bae8f15e16cd14348bb7bd716bbc81cb.tar.bz2 |
Avoid a call to find by using the return value of insert.
Diffstat (limited to 'gold/gc.cc')
-rw-r--r-- | gold/gc.cc | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -40,15 +40,8 @@ Garbage_collection::do_transitive_closure() // one by one. Section_id entry = this->worklist().front(); this->worklist().pop(); - if (this->referenced_list().find(entry) - == this->referenced_list().end()) - { - this->referenced_list().insert(entry); - } - else - { - continue; - } + if (!this->referenced_list().insert(entry).second) + continue; Garbage_collection::Section_ref::iterator find_it = this->section_reloc_map().find(entry); if (find_it == this->section_reloc_map().end()) |