fix bug compare
This commit is contained in:
@@ -101,6 +101,13 @@ function isSavePlateOther(type, timestamp, plate) {
|
||||
return false;
|
||||
} else if (levenshtein(plate, currentInOther[i].plate) < 2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < currentIn.length; i++) {
|
||||
if ((timestamp - currentIn[i].time) < 600) {
|
||||
if (plate === currentIn[i].plate) {
|
||||
return false;
|
||||
} else if (levenshtein(plate, currentIn[i].plate) < 3) {
|
||||
return false;
|
||||
}
|
||||
@@ -119,6 +126,15 @@ function isSavePlateOther(type, timestamp, plate) {
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < currentOut.length; i++) {
|
||||
if ((timestamp - currentOut[i].time) < 600) {
|
||||
if (plate === currentOut[i].plate) {
|
||||
return false;
|
||||
} else if (levenshtein(plate, currentOut[i].plate) < 3) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user