Renamed colorX, colorY local variables in QrCode.getPenaltyScore() to just color, in all language versions.

This commit is contained in:
Project Nayuki 2018-10-26 03:47:04 +00:00
parent 025400e706
commit a14de3d959
7 changed files with 40 additions and 40 deletions

View File

@ -632,10 +632,10 @@ static long getPenaltyScore(const uint8_t qrcode[]) {
// Adjacent modules in row having same color
for (int y = 0; y < qrsize; y++) {
bool colorX = false;
bool color = false;
for (int x = 0, runX = -1; x < qrsize; x++) {
if (x == 0 || getModule(qrcode, x, y) != colorX) {
colorX = getModule(qrcode, x, y);
if (x == 0 || getModule(qrcode, x, y) != color) {
color = getModule(qrcode, x, y);
runX = 1;
} else {
runX++;
@ -648,10 +648,10 @@ static long getPenaltyScore(const uint8_t qrcode[]) {
}
// Adjacent modules in column having same color
for (int x = 0; x < qrsize; x++) {
bool colorY = false;
bool color = false;
for (int y = 0, runY = -1; y < qrsize; y++) {
if (y == 0 || getModule(qrcode, x, y) != colorY) {
colorY = getModule(qrcode, x, y);
if (y == 0 || getModule(qrcode, x, y) != color) {
color = getModule(qrcode, x, y);
runY = 1;
} else {
runY++;

View File

@ -430,10 +430,10 @@ long QrCode::getPenaltyScore() const {
// Adjacent modules in row having same color
for (int y = 0; y < size; y++) {
bool colorX = false;
bool color = false;
for (int x = 0, runX = -1; x < size; x++) {
if (x == 0 || module(x, y) != colorX) {
colorX = module(x, y);
if (x == 0 || module(x, y) != color) {
color = module(x, y);
runX = 1;
} else {
runX++;
@ -446,10 +446,10 @@ long QrCode::getPenaltyScore() const {
}
// Adjacent modules in column having same color
for (int x = 0; x < size; x++) {
bool colorY = false;
bool color = false;
for (int y = 0, runY = -1; y < size; y++) {
if (y == 0 || module(x, y) != colorY) {
colorY = module(x, y);
if (y == 0 || module(x, y) != color) {
color = module(x, y);
runY = 1;
} else {
runY++;

View File

@ -597,10 +597,10 @@ public final class QrCode {
// Adjacent modules in row having same color
for (int y = 0; y < size; y++) {
boolean colorX = false;
boolean color = false;
for (int x = 0, runX = 0; x < size; x++) {
if (x == 0 || modules[y][x] != colorX) {
colorX = modules[y][x];
if (x == 0 || modules[y][x] != color) {
color = modules[y][x];
runX = 1;
} else {
runX++;
@ -613,10 +613,10 @@ public final class QrCode {
}
// Adjacent modules in column having same color
for (int x = 0; x < size; x++) {
boolean colorY = false;
boolean color = false;
for (int y = 0, runY = 0; y < size; y++) {
if (y == 0 || modules[y][x] != colorY) {
colorY = modules[y][x];
if (y == 0 || modules[y][x] != color) {
color = modules[y][x];
runY = 1;
} else {
runY++;

View File

@ -429,9 +429,9 @@ var qrcodegen = new function() {
// Adjacent modules in row having same color
for (var y = 0; y < size; y++) {
for (var x = 0, runX, colorX; x < size; x++) {
if (x == 0 || modules[y][x] != colorX) {
colorX = modules[y][x];
for (var x = 0, runX, color; x < size; x++) {
if (x == 0 || modules[y][x] != color) {
color = modules[y][x];
runX = 1;
} else {
runX++;
@ -444,9 +444,9 @@ var qrcodegen = new function() {
}
// Adjacent modules in column having same color
for (var x = 0; x < size; x++) {
for (var y = 0, runY, colorY; y < size; y++) {
if (y == 0 || modules[y][x] != colorY) {
colorY = modules[y][x];
for (var y = 0, runY, color; y < size; y++) {
if (y == 0 || modules[y][x] != color) {
color = modules[y][x];
runY = 1;
} else {
runY++;

View File

@ -465,8 +465,8 @@ class QrCode(object):
# Adjacent modules in row having same color
for y in range(size):
for x in range(size):
if x == 0 or modules[y][x] != colorx:
colorx = modules[y][x]
if x == 0 or modules[y][x] != color:
color = modules[y][x]
runx = 1
else:
runx += 1
@ -477,8 +477,8 @@ class QrCode(object):
# Adjacent modules in column having same color
for x in range(size):
for y in range(size):
if y == 0 or modules[y][x] != colory:
colory = modules[y][x]
if y == 0 or modules[y][x] != color:
color = modules[y][x]
runy = 1
else:
runy += 1

View File

@ -647,11 +647,11 @@ impl QrCode {
// Adjacent modules in row having same color
for y in 0 .. size {
let mut colorx = false;
let mut color = false;
let mut runx: i32 = 0;
for x in 0 .. size {
if x == 0 || self.module(x, y) != colorx {
colorx = self.module(x, y);
if x == 0 || self.module(x, y) != color {
color = self.module(x, y);
runx = 1;
} else {
runx += 1;
@ -665,11 +665,11 @@ impl QrCode {
}
// Adjacent modules in column having same color
for x in 0 .. size {
let mut colory = false;
let mut color = false;
let mut runy: i32 = 0;
for y in 0 .. size {
if y == 0 || self.module(x, y) != colory {
colory = self.module(x, y);
if y == 0 || self.module(x, y) != color {
color = self.module(x, y);
runy = 1;
} else {
runy += 1;

View File

@ -512,9 +512,9 @@ namespace qrcodegen {
// Adjacent modules in row having same color
for (let y = 0; y < this.size; y++) {
for (let x = 0, runX = 0, colorX = false; x < this.size; x++) {
if (x == 0 || this.modules[y][x] != colorX) {
colorX = this.modules[y][x];
for (let x = 0, runX = 0, color = false; x < this.size; x++) {
if (x == 0 || this.modules[y][x] != color) {
color = this.modules[y][x];
runX = 1;
} else {
runX++;
@ -527,9 +527,9 @@ namespace qrcodegen {
}
// Adjacent modules in column having same color
for (let x = 0; x < this.size; x++) {
for (let y = 0, runY = 0, colorY = false; y < this.size; y++) {
if (y == 0 || this.modules[y][x] != colorY) {
colorY = this.modules[y][x];
for (let y = 0, runY = 0, color = false; y < this.size; y++) {
if (y == 0 || this.modules[y][x] != color) {
color = this.modules[y][x];
runY = 1;
} else {
runY++;