diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-05-11 13:33:51 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-05-12 14:50:09 -0400 |
commit | efe2296bde30c22124ed31b70b7d860339927471 (patch) | |
tree | 67e79dd4038aae3ebb3113b83512b9ef05af6788 /gdb/cli | |
parent | 9c0fb73485cb2c90bb10cb4d3cf1d27e36f9ff01 (diff) | |
download | binutils-efe2296bde30c22124ed31b70b7d860339927471.zip binutils-efe2296bde30c22124ed31b70b7d860339927471.tar.gz binutils-efe2296bde30c22124ed31b70b7d860339927471.tar.bz2 |
gdb: remove unnecessary call to std::string constructor
I spotted this explicit call to std::string, which creates an
unnecessary temporary extra std::string, while calling emplace_back.
I'm not sure if it has any impact in an optimized build, maybe the
compiler elides it. But still, it's unnecessary.
Change-Id: I873337ea91db29ac06267aff8fc12dcf52824cac
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-decode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 948592a..b84ce83 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -155,7 +155,7 @@ cmd_list_element::command_components () const if (this->prefix != nullptr) result = this->prefix->command_components (); - result.emplace_back (std::string (this->name)); + result.emplace_back (this->name); return result; } |