194: Refactoring/Review

This commit is contained in:
Christoph Oberhofer
2017-05-22 21:47:01 +02:00
parent d01cd6d527
commit 55d2eb971b
5 changed files with 8 additions and 15 deletions
+1 -4
View File
@@ -24,7 +24,6 @@ var N = 1,
]},
SINGLE_CODE_ERROR: {value: 0.78, writable: true},
AVG_CODE_ERROR: {value: 0.30, writable: true},
MAX_CORRECTION_FACTOR: {value: 5},
FORMAT: {value: "2of5"}
};
@@ -47,7 +46,6 @@ TwoOfFiveReader.prototype._findPattern = function(pattern, offset, isWhite, tryH
error,
j,
sum,
normalized,
epsilon = self.AVG_CODE_ERROR;
isWhite = isWhite || false;
@@ -242,8 +240,7 @@ TwoOfFiveReader.prototype._decode = function() {
if (!code) {
return null;
}
if (result.length % 2 !== 0 ||
result.length < 6) {
if (result.length < 5) {
return null;
}