On Thu, Feb 13, 2025 at 02:01:29PM +0100, Jean-Marc Lasgouttes wrote:
> 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).

Ok, I see.

> 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.

In most of committed changes I agree, if the temporary variable is called
"temp" there is no advantage in having it. But the cases for "name" and
"state" or "command" variable in the next commit improve immediate 
readability of the code, at least for me.

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

Reply via email to