Use std::make_unique in more places

I searched for spots using ".reset (new ...)" and replaced most of
these with std::make_unique.  I think this is a bit cleaner and more
idiomatic.

Regression tested on x86-64 Fedora 40.

Reviewed-By: Klaus Gerlicher<klaus.gerlicher@intel.com>
This commit is contained in:
Tom Tromey
2024-10-08 19:31:51 -06:00
parent 32dc367249
commit 40ae603e6e
11 changed files with 35 additions and 31 deletions

View File

@@ -3049,7 +3049,7 @@ get_remote_thread_info (thread_info *thread)
gdb_assert (thread != NULL);
if (thread->priv == NULL)
thread->priv.reset (new remote_thread_info);
thread->priv = std::make_unique<remote_thread_info> ();
return gdb::checked_static_cast<remote_thread_info *> (thread->priv.get ());
}
@@ -7099,7 +7099,7 @@ static remote_inferior *
get_remote_inferior (inferior *inf)
{
if (inf->priv == NULL)
inf->priv.reset (new remote_inferior);
inf->priv = std::make_unique<remote_inferior> ();
return gdb::checked_static_cast<remote_inferior *> (inf->priv.get ());
}