commit 5f8f9ed91297ea3d8385665dd625210dd2fffec0
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Sat Feb 15 20:31:12 2025 +0100

    Avoid temporary variable (spotted by Coverity Scan)
---
 src/Buffer.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 489d4dc774..ce796e7069 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -132,6 +132,8 @@ typedef map<string, bool> DepClean;
 
 // Information about labels and their associated refs
 struct LabelInfo {
+       LabelInfo(docstring const & l, InsetLabel const * il, bool act)
+               : label(l), inset(il), active(act) {}
        /// label string
        docstring label;
        /// label inset
@@ -4098,11 +4100,7 @@ void Buffer::addReference(docstring const & label, Inset 
* inset, ParIterator it
 void Buffer::setInsetLabel(docstring const & label, InsetLabel const * il,
                           bool const active)
 {
-       LabelInfo linfo;
-       linfo.label = label;
-       linfo.inset = il;
-       linfo.active = active;
-       masterBuffer()->d->label_cache_.push_back(linfo);
+       masterBuffer()->d->label_cache_.emplace_back(label, il, active);
 }
 
 
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to