Only allocate a StringBuffer if the start pattern has been found successfully in the ITFReader.

git-svn-id: https://zxing.googlecode.com/svn/trunk@958 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2009-05-27 21:11:10 +00:00
parent 0827af1d89
commit 932715065b

View file

@ -77,14 +77,12 @@ public final class ITFReader extends AbstractOneDReader {
public Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws ReaderException {
StringBuffer result = new StringBuffer(20);
// Find out where the Middle section (payload) starts & ends
int[] startRange = decodeStart(row);
int[] endRange = decodeEnd(row);
StringBuffer result = new StringBuffer(20);
decodeMiddle(row, startRange[1], endRange[0], result);
String resultString = result.toString();
int[] allowedLengths = null;