Fix LGTM and revert bugfix for later PR

This commit is contained in:
Bharat123rox 2019-05-22 11:23:27 +05:30
parent 945ccac85a
commit 0bf45e81e7
2 changed files with 1 additions and 2 deletions

View File

@ -39,7 +39,7 @@ UNICHAR_ID UNICHARMAP::unichar_to_id(const char* const unichar_repr,
assert(length > 0 && length <= UNICHAR_LEN);
int index = 0;
if (unichar_repr[index] == '\0') return INVALID_UNICHAR_ID;
if (length <= 0 || unichar_repr[index] == '\0') return INVALID_UNICHAR_ID;
do {
if (index + 1 >= length || unichar_repr[index + 1] == '\0')
return current_nodes[static_cast<unsigned char>(unichar_repr[index])].id;

View File

@ -618,7 +618,6 @@ void TrainingSampleSet::ComputeCanonicalSamples(const IntFeatureMap& map,
if (dist > max_dist) {
max_dist = dist;
if (dist > max_max_dist) {
max_max_dist = dist;
max_s1 = s1;
max_s2 = s2;
}