Le 13/02/2025 à 13:43, Pavel Sanda a écrit :
I do not know how others see it, but I do not fight these as a necessary 
improvements.
You squashed temporary and little of CPU time, but unless it's in time critical 
code
path the savings are negligible, but you lost semantics.

When I see in the code

string const name = cmd.getArg(0);
string const state = cmd.getArg(1);

I have idea what getArg(0)/getArg(1) are supposed to mean and can even
fix bugs if something goes wrong.

Seeing just  if (GuiToolbar * t = toolbar(cmd.getArg(0)))
gives me no idea what arg 0 should be.

Could we reconsider whether to follow all coverity suggestions?

I didi not follow all coverity suggestions today. I fixed 12 of them and, according to coverity's new stats, ignored 8 additional ones (I though I ignored more of those actually).

In this case, the nearby code is:

        case LFUN_TOOLBAR_TOGGLE: {
                string const name = cmd.getArg(0);
                if (GuiToolbar * t = toolbar(name))
                        flag.setOnOff(t->isVisible());
                else {
                        enable = false;
                        docstring const msg =
                                bformat(_("Unknown toolbar \"%1$s\""), 
from_utf8(name));
                        flag.message(msg);
                }
                break;
        }

This second one is not my doing, AFAIR.

Note that my main reason for doing the change here is to shut coverity up. I could equally do that by Ignore-ing the issue if the consensus is that it is better. In this case, I thought that using cmd.getArg(1) as a parameter of setState() was a good enough hint.

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to