1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
From aab258adbd9c78931a36b96e58975a08000249a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 10 Feb 2017 17:14:35 +0000
Subject: [PATCH 4/4] either clear will be called anyway before use, or its
unused afterwards
---
src/hunspell/suggestmgr.cxx | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
index ea52707..ae34535 100644
--- a/src/hunspell/suggestmgr.cxx
+++ b/src/hunspell/suggestmgr.cxx
@@ -1089,7 +1089,6 @@ void SuggestMgr::ngsuggest(std::vector<std::string>& wlst,
continue;
if (utf8) {
- w_f.clear();
u8_u16(w_f, HENTRY_WORD(hp));
int leftcommon = leftcommonsubstring(w_word, w_f);
@@ -1115,7 +1114,6 @@ void SuggestMgr::ngsuggest(std::vector<std::string>& wlst,
copy_field(f, HENTRY_DATA(hp), MORPH_PHON)) {
int sc2;
if (utf8) {
- w_f.clear();
u8_u16(w_f, f);
int leftcommon = leftcommonsubstring(w_word, w_f);
@@ -1139,7 +1137,6 @@ void SuggestMgr::ngsuggest(std::vector<std::string>& wlst,
int scphon = -20000;
if (ph && (sc > 2) && (abs(n - (int)hp->clen) <= 3)) {
if (utf8) {
- w_candidate.clear();
u8_u16(w_candidate, HENTRY_WORD(hp));
mkallcap_utf(w_candidate, langnum);
u16_u8(candidate, w_candidate);
@@ -1148,7 +1145,6 @@ void SuggestMgr::ngsuggest(std::vector<std::string>& wlst,
mkallcap(candidate, csconv);
}
f = phonet(candidate, *ph);
- w_f.clear();
if (utf8) {
u8_u16(w_f, f);
scphon = 2 * ngram(3, w_target, w_f,
@@ -1254,7 +1250,6 @@ void SuggestMgr::ngsuggest(std::vector<std::string>& wlst,
for (int k = 0; k < nw; k++) {
if (utf8) {
- w_f.clear();
u8_u16(w_f, glst[k].word);
int leftcommon = leftcommonsubstring(w_word, w_f);
@@ -1335,7 +1330,6 @@ void SuggestMgr::ngsuggest(std::vector<std::string>& wlst,
std::string gl;
int len;
if (utf8) {
- w_gl.clear();
len = u8_u16(w_gl, guess[i]);
mkallsmall_utf(w_gl, langnum);
u16_u8(gl, w_gl);
@@ -1355,7 +1349,6 @@ void SuggestMgr::ngsuggest(std::vector<std::string>& wlst,
}
// using 2-gram instead of 3, and other weightening
- w_gl.clear();
if (utf8) {
u8_u16(w_gl, gl);
//w_gl is lowercase already at this point
@@ -1421,7 +1414,6 @@ void SuggestMgr::ngsuggest(std::vector<std::string>& wlst,
// lowering rootphon[i]
std::string gl;
int len;
- w_gl.clear();
if (utf8) {
len = u8_u16(w_gl, rootsphon[i]);
mkallsmall_utf(w_gl, langnum);
--
2.9.3
|