diff options
| author | Simon Marchi <simon.marchi@polymtl.ca> | 2026-03-01 22:26:06 -0500 |
|---|---|---|
| committer | Simon Marchi <simon.marchi@polymtl.ca> | 2026-03-01 22:27:55 -0500 |
| commit | bd0babf07de17da6e8e536ceb4dd940d0ed6a0d0 (patch) | |
| tree | e100b0028974573e36342cc1773f7266bd3d96c2 | |
| parent | dd9a411627a249b7b3dfb4ad879c62d862dc93e3 (diff) | |
| download | binutils-master.zip binutils-master.tar.gz binutils-master.tar.bz2 | |
Sonarqube in me IDE pointed out this "const string" parameter that
should be a reference. I then looked at the callers, and saw that one
would pass `.c_str()`, causing an unnecessary copy, and the other using
std::move unnecessarily.
Change-Id: I29a84a9d2fad79ac68a66a95553a30173fa3544c
| -rw-r--r-- | gdb/linux-tdep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 1cd35e5..2bf35a2 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -1384,7 +1384,7 @@ typedef bool linux_dump_mapping_p_ftype (filter_flags filterflags, static std::vector<struct smaps_data> parse_smaps_data (const char *data, - const std::string maps_filename) + const std::string &maps_filename) { char *line, *t; @@ -1633,7 +1633,7 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, /* Parse the contents of smaps into a vector. */ std::vector<struct smaps_data> smaps - = parse_smaps_data (data.get (), maps_filename.c_str ()); + = parse_smaps_data (data.get (), maps_filename); for (const struct smaps_data &map : smaps) { @@ -3100,7 +3100,7 @@ linux_address_in_shadow_stack_mem_range return false; const std::vector<smaps_data> smaps - = parse_smaps_data (data.get (), std::move (smaps_file)); + = parse_smaps_data (data.get (), smaps_file); auto find_addr_mem_range = [&addr] (const smaps_data &map) { |
