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

@@ -10494,9 +10494,9 @@ watch_command_1 (const char *arg, int accessflag, int from_tty,
std::unique_ptr<watchpoint> w;
if (use_mask)
w.reset (new masked_watchpoint (nullptr, bp_type));
w = std::make_unique<masked_watchpoint> (nullptr, bp_type);
else
w.reset (new watchpoint (nullptr, bp_type));
w = std::make_unique<watchpoint> (nullptr, bp_type);
/* At most one of thread or task can be set on a watchpoint. */
gdb_assert (thread == -1 || task == -1);