Le 13/02/2025 à 18:08, Thibaut Cuvelier a écrit :
I understand that the problem that Coverity sees is a copy. We could
avoid that using std::string_view, new in C++17, I think: it's just a
pointer to a std::string that you can use more or less like a
std::string (unlike a pointer).
Coverity wants us to do
viewer_alternatives[format].insert(std::move(command));
because command is not used afterwards.
But we do not want to do this since it makes the code less legible, and
the broken command string is still usable afterwards without complaint
from the compiler.
What I think is that we do not care here about the speed gains. For
several of these issues, I just told Coverity to ignore them. I thought
that in this particular case it was an occasion to make the code
clearer, but it seems that I was wrong. I will therefore revert some of
these commits.
JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-devel