On 2/13/25 6:18 AM, Jean-Marc Lasgouttes wrote:
commit c7693e77f7b3784861ef0c9a0b64c54146a1c5cf
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu Feb 13 12:17:34 2025 +0100

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

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 72411ba4fe..7f0ec11caa 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2924,7 +2924,6 @@ void Buffer::dispatch(FuncRequest const & func, 
DispatchResult & dr)
                dr.dispatched(false);
                return;
        }
-       string const argument = to_utf8(func.argument());
        // We'll set this back to false if need be.
        bool dispatched = true;
        // This handles undo groups automagically
@@ -2942,8 +2941,9 @@ void Buffer::dispatch(FuncRequest const & func, 
DispatchResult & dr)
                break;
case LFUN_BUFFER_EXPORT: {
-               string const format = (argument.empty() || argument == 
"default") ?
-                       params().getDefaultOutputFormat() : argument;
+               string const & arg = to_utf8(func.argument());

This can't be a reference, can it?

Riki


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

Reply via email to