diff --git a/src/io/nayuki/fastqrcodegen/QrCode.java b/src/io/nayuki/fastqrcodegen/QrCode.java index a1e71e0..dcd958f 100644 --- a/src/io/nayuki/fastqrcodegen/QrCode.java +++ b/src/io/nayuki/fastqrcodegen/QrCode.java @@ -559,7 +559,7 @@ public final class QrCode { // Returns 0 or 1 based on the i'th bit of x. - private static int getBit(int x, int i) { + static int getBit(int x, int i) { return (x >>> i) & 1; } diff --git a/src/io/nayuki/fastqrcodegen/QrTemplate.java b/src/io/nayuki/fastqrcodegen/QrTemplate.java index 41306d1..9ecbbbd 100644 --- a/src/io/nayuki/fastqrcodegen/QrTemplate.java +++ b/src/io/nayuki/fastqrcodegen/QrTemplate.java @@ -173,7 +173,7 @@ final class QrTemplate { // Draw two copies for (int i = 0; i < 18; i++) { - int bit = (bits >>> i) & 1; + int bit = QrCode.getBit(bits, i); int a = size - 11 + i % 3; int b = i / 3; darkenFunctionModule(a, b, bit); @@ -260,7 +260,7 @@ final class QrTemplate { assert 0 <= x && x < size; assert 0 <= y && y < size; int i = y * size + x; - return (grid[i >>> 5] >>> i) & 1; + return QrCode.getBit(grid[i >>> 5], i); }