On 2/13/25 5:59 AM, Jean-Marc Lasgouttes wrote:
commit b4a982e0229ea953d458a495e56e7362c6a3b78b
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu Feb 13 11:57:11 2025 +0100

     avoid temporary variables (spotted by Coverity Scan)
---
  src/LyXRC.cpp | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 4309fc41d4..966b2ce410 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -958,16 +958,14 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool 
check_format)
                case RC_VIEWER_ALTERNATIVES:  {
                        string format, command;
                        if ((lexrc >> format) && lexrc.next(true)) {
-                               command  = lexrc.getString();
-                               viewer_alternatives[format].insert(command);
+                               
viewer_alternatives[format].insert(lexrc.getString());

Perhaps a compromise would be to include a comment, or even to leave it as:

// command  = lexrc.getString();
viewer_alternatives[format].insert(lexrc.getString());

One could simply do this as such cases were fixed.

Riki

--
----------------------------
Richard Kimberly (Riki) Heck
Professor of Philosophy and Professor of Linguistics
Brown University

Pronouns: they/them/their
Website:  http://rkheck.frege.org/

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

Reply via email to