diff --git a/core/src/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java b/core/src/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java index e50891b65..2827e7303 100644 --- a/core/src/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java +++ b/core/src/com/google/zxing/common/reedsolomon/ReedSolomonDecoder.java @@ -138,9 +138,9 @@ public final class ReedSolomonDecoder { private int[] findErrorLocations(GF256Poly errorLocator) throws ReedSolomonException { // This is a direct application of Chien's search int numErrors = errorLocator.getDegree(); - //if (numErrors == 1) { // shortcut - // return new int[] { errorLocator.getCoefficient(1) }; - //} + if (numErrors == 1) { // shortcut + return new int[] { errorLocator.getCoefficient(1) }; + } int[] result = new int[numErrors]; int e = 0; for (int i = 1; i < 256 && e < numErrors; i++) { @@ -158,9 +158,6 @@ public final class ReedSolomonDecoder { private int[] findErrorMagnitudes(GF256Poly errorEvaluator, int[] errorLocations) { // This is directly applying Forney's Formula int s = errorLocations.length; - //if (s == 1) { // shortcut - // return new int[] { errorEvaluator.getCoefficient(0) }; - //} int[] result = new int[s]; for (int i = 0; i < s; i++) { int xiInverse = field.inverse(errorLocations[i]); diff --git a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java index f1a90751a..94ccc5e0e 100644 --- a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java +++ b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java @@ -108,7 +108,7 @@ public abstract class AbstractBlackBoxTestCase extends TestCase { if (passed) { passedCount++; } else { - System.out.println("Mismatch: expected '" + expectedText + "' but got '" + resultText + '\''); + fail("Mismatch: expected '" + expectedText + "' but got '" + resultText + '\''); } // Try "try harder" mode