use std::move() instead of copying when value is no longer used

This is mainly to shut down coverity which nowadays nags on this.
I am not sure whether we really gain something in these cases.
This commit is contained in:
Juergen Spitzmueller 2024-09-07 12:50:27 +02:00
parent 458f39cc43
commit e685d31f5a
3 changed files with 3 additions and 3 deletions

View File

@ -1707,7 +1707,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
string label = dit.innerParagraph().getLabelForXRef();
if (!label.empty()) {
// if the paragraph has a label, we refer to this
string const arg = (type.empty()) ? label : label + " " + type;
string const arg = (type.empty()) ? move(label) : move(label) + " " + type;
lyx::dispatch(FuncRequest(LFUN_REFERENCE_INSERT, arg));
break;
} else {

View File

@ -798,7 +798,7 @@ docstring Encodings::convertLaTeXCommands(docstring const & str, bool const lite
if (!cnvtd.empty()) {
// it did, so we'll take that bit and proceed with what's left
ret += cnvtd;
val = rem;
val = move(rem);
continue;
}
// it's a command of some sort

View File

@ -440,7 +440,7 @@ docstring nomenclWidest(Buffer const & buffer)
msymb.size();
if (wx > w) {
w = wx;
symb = symbol;
symb = move(symbol);
}
}
}