diff options
author | Tom de Vries <tdevries@suse.de> | 2023-11-28 16:31:07 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-11-28 16:31:07 +0100 |
commit | 1f6ce803887ac8da6d4b5903fa270dfa63c63bbf (patch) | |
tree | 1c418e75995a9c8fd640928dd6f2788bfea0a623 /config | |
parent | 9d4db627b2a6a78f7f7959668da94e79e17a7e34 (diff) | |
download | gdb-1f6ce803887ac8da6d4b5903fa270dfa63c63bbf.zip gdb-1f6ce803887ac8da6d4b5903fa270dfa63c63bbf.tar.gz gdb-1f6ce803887ac8da6d4b5903fa270dfa63c63bbf.tar.bz2 |
[gdb/tui] Use const std::string for string literals in tui-stack.c
I noticed in gdb/tui/tui-stack.c a source-level micro-optimization where
strlen with a string literal argument:
...
strlen ("bla")
...
is replaced with sizeof:
...
sizeof ("bla") - 1
...
The benefit of this is that the optimization is also done at O0, but the
drawback is that it makes the expression harder to read.
Use const std::string to encapsulate the string literals, and use
std::string::size () instead.
I tried making the string names (PROC_PREFIX, LINE_PREFIX, PC_PREFIX and
SINGLE_KEY) lower-case, but that clashed with a pre-existing pc_prefix, so
I've left them upper-case.
Tested on x86_64-linux.
Tested-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
Diffstat (limited to 'config')
0 files changed, 0 insertions, 0 deletions