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.
This commit is contained in:
Jean-Marc Lasgouttes 2024-01-12 15:28:39 +01:00
parent 765c380a5b
commit 1599c503df

View File

@ -494,8 +494,13 @@ void TeXEnvironment(Buffer const & buf, Text const & text,
}
void getArgInsets(otexstream & os, OutputParams const & runparams, Layout::LaTeXArgMap const & latexargs,
map<size_t, lyx::InsetArgument const *> ilist, vector<string> 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<size_t, lyx::InsetArgument const *> const & ilist,
vector<string> required, string const & prefix)
{
size_t const argnr = latexargs.size();
if (argnr == 0)