mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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:
parent
0827af1d89
commit
932715065b
|
@ -77,14 +77,12 @@ public final class ITFReader extends AbstractOneDReader {
|
||||||
|
|
||||||
public Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws ReaderException {
|
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
|
// Find out where the Middle section (payload) starts & ends
|
||||||
int[] startRange = decodeStart(row);
|
int[] startRange = decodeStart(row);
|
||||||
int[] endRange = decodeEnd(row);
|
int[] endRange = decodeEnd(row);
|
||||||
|
|
||||||
|
StringBuffer result = new StringBuffer(20);
|
||||||
decodeMiddle(row, startRange[1], endRange[0], result);
|
decodeMiddle(row, startRange[1], endRange[0], result);
|
||||||
|
|
||||||
String resultString = result.toString();
|
String resultString = result.toString();
|
||||||
|
|
||||||
int[] allowedLengths = null;
|
int[] allowedLengths = null;
|
||||||
|
|
Loading…
Reference in a new issue