Skip to content

Commit 0bf45e8

Browse files
committed
Fix LGTM and revert bugfix for later PR
1 parent 945ccac commit 0bf45e8

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/ccutil/unicharmap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ UNICHAR_ID UNICHARMAP::unichar_to_id(const char* const unichar_repr,
3939
assert(length > 0 && length <= UNICHAR_LEN);
4040

4141
int index = 0;
42-
if (unichar_repr[index] == '\0') return INVALID_UNICHAR_ID;
42+
if (length <= 0 || unichar_repr[index] == '\0') return INVALID_UNICHAR_ID;
4343
do {
4444
if (index + 1 >= length || unichar_repr[index + 1] == '\0')
4545
return current_nodes[static_cast<unsigned char>(unichar_repr[index])].id;

src/classify/trainingsampleset.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ void TrainingSampleSet::ComputeCanonicalSamples(const IntFeatureMap& map,
618618
if (dist > max_dist) {
619619
max_dist = dist;
620620
if (dist > max_max_dist) {
621-
max_max_dist = dist;
622621
max_s1 = s1;
623622
max_s2 = s2;
624623
}

0 commit comments

Comments
 (0)