commit 573ef39ad23c494c2159435f206ffa598ab9aed3
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Wed Feb 12 14:46:11 2025 +0100
Avoid copying Error objects (spotted by Coverity Scan)
---
src/LaTeX.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index afc3eb5c32..8e72b6715d 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -75,8 +75,7 @@ void TeXErrors::insertError(int line, docstring const &
error_desc,
docstring const & error_text,
string const & child_name)
{
- Error newerr(line, error_desc, error_text, child_name);
- errors.push_back(newerr);
+ errors.emplace_back(line, error_desc, error_text, child_name);
}
@@ -84,8 +83,7 @@ void TeXErrors::insertRef(int line, docstring const &
error_desc,
docstring const & error_text,
string const & child_name)
{
- Error newerr(line, error_desc, error_text, child_name);
- undef_ref.push_back(newerr);
+ undef_ref.emplace_back(line, error_desc, error_text, child_name);
}
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs