De-optimized a bit of Java code to tighten scope at the expense of allocating more temporary memory.

This commit is contained in:
Project Nayuki 2020-01-29 17:23:44 +00:00
parent 2da5091674
commit ae22a368bb
1 changed files with 2 additions and 3 deletions

View File

@ -596,11 +596,10 @@ public final class QrCode {
int result = 0;
// Adjacent modules in row having same color, and finder-like patterns
int[] runHistory = new int[7];
for (int y = 0; y < size; y++) {
boolean runColor = false;
int runX = 0;
Arrays.fill(runHistory, 0);
int[] runHistory = new int[7];
int padRun = size; // Add white border to initial run
for (int x = 0; x < size; x++) {
if (modules[y][x] == runColor) {
@ -624,7 +623,7 @@ public final class QrCode {
for (int x = 0; x < size; x++) {
boolean runColor = false;
int runY = 0;
Arrays.fill(runHistory, 0);
int[] runHistory = new int[7];
int padRun = size; // Add white border to initial run
for (int y = 0; y < size; y++) {
if (modules[y][x] == runColor) {