[LyX/2.3.x] Do not for copies in range-based for loops.

Jean-Marc Lasgouttes lasgouttes at lyx.org
Fri Oct 15 15:48:35 UTC 2021


commit 4d410d0d32a6ade8e5ee27f4390a0340ed8d5b60
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Tue Apr 28 13:27:50 2020 +0200

    Do not for copies in range-based for loops.
    
    Spotted by clang++ 10.
    
    (cherry picked from commit a85c48de5a15c4f70f79a53b451fbe0d083e9ece)
---
 src/HunspellChecker.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/HunspellChecker.cpp b/src/HunspellChecker.cpp
index 593a123..c211b47 100644
--- a/src/HunspellChecker.cpp
+++ b/src/HunspellChecker.cpp
@@ -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;


More information about the lyx-cvs mailing list