From 9e9890ada9027eb7e31d3b2d9e0a2d1d2f1d3172 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Wed, 29 Nov 2017 23:12:14 +0000 Subject: [PATCH] Inlined a private method. --- src/io/nayuki/fastqrcodegen/QrCode.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/io/nayuki/fastqrcodegen/QrCode.java b/src/io/nayuki/fastqrcodegen/QrCode.java index 9eb2d06..bc16556 100644 --- a/src/io/nayuki/fastqrcodegen/QrCode.java +++ b/src/io/nayuki/fastqrcodegen/QrCode.java @@ -161,8 +161,11 @@ public final class QrCode { * @return the module's color, which is either false (white) or true (black) */ public boolean getModule(int x, int y) { - return 0 <= x && x < size && 0 <= y && y < size - && getModuleUnchecked(x, y) != 0; + if (0 <= x && x < size && 0 <= y && y < size) { + int i = y * size + x; + return ((modules[i >>> 5] >>> i) & 1) != 0; + } else + return false; } @@ -273,12 +276,6 @@ public final class QrCode { } - private int getModuleUnchecked(int x, int y) { - int i = y * size + x; - return (modules[i >>> 5] >>> i) & 1; - } - - /*---- Private helper methods for constructor: Codewords and masking ----*/ // Returns a new byte string representing the given data with the appropriate error correction