mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Optimize buffer size (#1013)
This commit is contained in:
parent
a372dfe175
commit
fa0e1d7556
|
@ -339,7 +339,7 @@ public final class BitArray implements Cloneable {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder result = new StringBuilder(size);
|
||||
StringBuilder result = new StringBuilder(size + (size / 8) + 1);
|
||||
for (int i = 0; i < size; i++) {
|
||||
if ((i & 0x07) == 0) {
|
||||
result.append(' ');
|
||||
|
|
|
@ -200,7 +200,7 @@ public final class BitMatrix implements Cloneable {
|
|||
|| rowSize != mask.getRowSize()) {
|
||||
throw new IllegalArgumentException("input matrix dimensions do not match");
|
||||
}
|
||||
BitArray rowArray = new BitArray(width / 32 + 1);
|
||||
BitArray rowArray = new BitArray(width);
|
||||
for (int y = 0; y < height; y++) {
|
||||
int offset = y * rowSize;
|
||||
int[] row = mask.getRow(y, rowArray).getBitArray();
|
||||
|
|
Loading…
Reference in a new issue