From 12360bec339a39c868c1b6445f32246d434393fb Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Fri, 10 Feb 2017 03:31:03 +0000 Subject: [PATCH] Added and updated a few comments in QrSegmentAdvanced. --- java/io/nayuki/qrcodegen/QrSegmentAdvanced.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/io/nayuki/qrcodegen/QrSegmentAdvanced.java b/java/io/nayuki/qrcodegen/QrSegmentAdvanced.java index 93dd67c..8a65084 100644 --- a/java/io/nayuki/qrcodegen/QrSegmentAdvanced.java +++ b/java/io/nayuki/qrcodegen/QrSegmentAdvanced.java @@ -111,7 +111,7 @@ public final class QrSegmentAdvanced { if (isAlphanumeric(c)) result[1][j] = result[1][i] + 33; // 5.5 bits per alphanumeric char if (isNumeric(c)) - result[2][j] = result[2][i] + 20; // 3.33 bits per alphanumeric char + result[2][j] = result[2][i] + 20; // 3.33 bits per digit // Switch modes, rounding up fractional bits result[0][j] = Math.min((Math.min(result[1][j], result[2][j]) + 5) / 6 * 6 + bytesCost , result[0][j]); @@ -387,7 +387,7 @@ public final class QrSegmentAdvanced { private static short[] UNICODE_TO_QR_KANJI = new short[65536]; - static { + static { // Unpack the Shift JIS table into a more computation-friendly form Arrays.fill(UNICODE_TO_QR_KANJI, (short)-1); byte[] bytes = Base64.getDecoder().decode(PACKED_QR_KANJI_TO_UNICODE); for (int i = 0; i < bytes.length; i += 2) {