Do not for copies in range-based for loops.

Spotted by clang++ 10.
This commit is contained in:
Jean-Marc Lasgouttes 2020-04-28 13:27:50 +02:00
parent e9e8069b17
commit a85c48de5a
3 changed files with 5 additions and 6 deletions

View File

@ -424,7 +424,7 @@ void HunspellChecker::suggest(WordLangTuple const & wl,
string const word_to_check = to_iconv_encoding(wl.word(), encoding);
#ifdef HAVE_HUNSPELL_CXXABI
vector<string> wlst = h->suggest(word_to_check);
for (auto const s : wlst)
for (auto const & s : wlst)
suggestions.push_back(remap_result(from_iconv_encoding(s, encoding)));
#else
char ** suggestion_list;
@ -449,7 +449,7 @@ void HunspellChecker::stem(WordLangTuple const & wl,
string const word_to_check = to_iconv_encoding(wl.word(), encoding);
#ifdef HAVE_HUNSPELL_CXXABI
vector<string> wlst = h->stem(word_to_check);
for (auto const s : wlst)
for (auto const & s : wlst)
suggestions.push_back(from_iconv_encoding(s, encoding));
#else
char ** suggestion_list;

View File

@ -238,7 +238,7 @@ int LaTeX::run(TeXErrors & terr)
// Also remove all children which are included
Buffer const * buf = theBufferList().getBufferFromTmp(file.absFileName());
if (buf && buf->params().maintain_unincluded_children == BufferParams::CM_Mostly) {
for (auto const incfile : buf->params().getIncludedChildren()) {
for (auto const & incfile : buf->params().getIncludedChildren()) {
string const incm =
DocFileName(changeExtension(makeAbsPath(incfile, path)
.absFileName(), ".tex")).mangledFileName();

View File

@ -2572,10 +2572,9 @@ void Preamble::parse(Parser & p, string const & forceclass,
if (i != string::npos)
h_paperfontsize.erase(i);
// Now those known specifically to the class
string fsize;
vector<string> class_fsizes = getVectorFromString(tc.opt_fontsize(), "|");
string const fsize_format = tc.fontsizeformat();
for (auto const fsize : class_fsizes) {
for (auto const & fsize : class_fsizes) {
string latexsize = subst(fsize_format, "$$s", fsize);
vector<string>::iterator it = find(opts.begin(), opts.end(), latexsize);
if (it != opts.end()) {
@ -2642,7 +2641,7 @@ void Preamble::parse(Parser & p, string const & forceclass,
string paper;
vector<string> class_psizes = getVectorFromString(tc.opt_pagesize(), "|");
string const psize_format = tc.pagesizeformat();
for (auto const psize : class_psizes) {
for (auto const & psize : class_psizes) {
string latexsize = subst(psize_format, "$$s", psize);
vector<string>::iterator it = find(opts.begin(), opts.end(), latexsize);
if (it != opts.end()) {