gdb: Use vector::emplace_back
Now that we require C++11, we can use vector::emplace_back to construct elements in place instead of constructing and then copying. gdb/ChangeLog: 2016-11-09 Pedro Alves <palves@redhat.com> * main.c (struct cmdarg): Add constructor. (captured_main_1): Use vector::emplace_back. * tracepoint.c (collection_list::add_memrange): Likewise.
This commit is contained in:
parent
8c84bffb45
commit
7a63494a0d
3 changed files with 17 additions and 22 deletions
|
@ -919,7 +919,7 @@ collection_list::add_memrange (int type, bfd_signed_vma base,
|
|||
/* type: memrange_absolute == memory, other n == basereg */
|
||||
/* base: addr if memory, offset if reg relative. */
|
||||
/* len: we actually save end (base + len) for convenience */
|
||||
m_memranges.push_back (memrange (type, base, base + len));
|
||||
m_memranges.emplace_back (type, base, base + len);
|
||||
|
||||
if (type != memrange_absolute) /* Better collect the base register! */
|
||||
add_register (type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue