From 1599c503df11b0c73b60e5c239f3cde9dcf73801 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 12 Jan 2024 15:28:39 +0100 Subject: [PATCH] Pass a two parameters parameter by reference Note that there is also a vector parameter that is passed by value. However it is modified as a local copy and I do not want to change this now. Spotted by coverity. --- src/output_latex.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 990ff4ac5a..5ec6a535a4 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -494,8 +494,13 @@ void TeXEnvironment(Buffer const & buf, Text const & text, } -void getArgInsets(otexstream & os, OutputParams const & runparams, Layout::LaTeXArgMap const & latexargs, - map ilist, vector required, string const & prefix) +// FIXME: pass the \c required vector by reference and add the stuff +// from \c latexargs to a different vector. This avoids a copy and +// (more importantly?) a coverity defect. +void getArgInsets(otexstream & os, OutputParams const & runparams, + Layout::LaTeXArgMap const & latexargs, + map const & ilist, + vector required, string const & prefix) { size_t const argnr = latexargs.size(); if (argnr == 0) -- 2.39.5