1 From f366e97fa8d7ad21060033b733dda15299edf7c5 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
3 Date: Fri, 10 Feb 2017 15:37:11 +0000
4 Subject: [PATCH 1/4] loop via iterators
7 src/hunspell/csutil.cxx | 8 ++++++--
8 1 file changed, 6 insertions(+), 2 deletions(-)
10 diff --git a/src/hunspell/csutil.cxx b/src/hunspell/csutil.cxx
11 index c1666a5..2408677 100644
12 --- a/src/hunspell/csutil.cxx
13 +++ b/src/hunspell/csutil.cxx
14 @@ -2537,13 +2537,17 @@ int get_captype_utf8(const std::vector<w_char>& word, int langnum) {
18 - for (size_t i = 0; i < word.size(); ++i) {
19 - unsigned short idx = (word[i].h << 8) + word[i].l;
21 + std::vector<w_char>::const_iterator it = word.begin();
22 + std::vector<w_char>::const_iterator it_end = word.end();
23 + while (it != it_end) {
24 + unsigned short idx = (it->h << 8) + it->l;
25 unsigned short lwridx = unicodetolower(idx, langnum);
28 if (unicodetoupper(idx, langnum) == lwridx)
33 unsigned short idx = (word[0].h << 8) + word[0].l;