Use reference result of emplace_back

Starting with C++17, emplace_back returns a reference to the new
object.  This patch changes code that uses emplace_back followed by a
call to back() to simply use this reference instead.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2024-02-03 14:32:06 -07:00
parent 029e52bac7
commit b36a26343a
12 changed files with 25 additions and 55 deletions

View File

@@ -4027,8 +4027,7 @@ start_thread (struct gdb_xml_parser *parser,
char *id = (char *) xml_find_attribute (attributes, "id")->value.get ();
ptid_t ptid = read_ptid (id, NULL);
data->items.emplace_back (ptid);
thread_item &item = data->items.back ();
thread_item &item = data->items.emplace_back (ptid);
attr = xml_find_attribute (attributes, "core");
if (attr != NULL)