On Mon, Nov 27, 2023 at 4:39 AM Tom de Vries wrote: > 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 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 them upper-case. > > Tested on x86_64-linux. > > The last paragraph of the commit message sounds a bit confusing, I mean "I've them upper-case". Maybe you could rephrase it? I can confirm the change adds no regressions on ppc64le Fedora Rawhide.