From f63f7f79a651cdfb1efbf8e564bb4f787cdea4fa Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Fri, 5 Oct 2018 01:44:06 +0000 Subject: [PATCH] Tweaked comment and blank line in QrCode constructor in some languages. --- javascript/qrcodegen.js | 3 ++- python/qrcodegen.py | 3 ++- typescript/qrcodegen.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/javascript/qrcodegen.js b/javascript/qrcodegen.js index efe2900..5c6835a 100644 --- a/javascript/qrcodegen.js +++ b/javascript/qrcodegen.js @@ -95,7 +95,7 @@ var qrcodegen = new function() { var allCodewords = addEccAndInterleave(dataCodewords); drawCodewords(allCodewords); - // Handle masking + // Do masking if (mask == -1) { // Automatically choose best mask var minPenalty = Infinity; for (var i = 0; i < 8; i++) { @@ -113,6 +113,7 @@ var qrcodegen = new function() { throw "Assertion error"; drawFormatBits(mask); // Overwrite old format bits applyMask(mask); // Apply the final choice of mask + isFunction = null; diff --git a/python/qrcodegen.py b/python/qrcodegen.py index dbbd5d3..0313f15 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -176,7 +176,7 @@ class QrCode(object): allcodewords = self._add_ecc_and_interleave(datacodewords) self._draw_codewords(allcodewords) - # Handle masking + # Do masking if mask == -1: # Automatically choose best mask minpenalty = 1 << 32 for i in range(8): @@ -191,6 +191,7 @@ class QrCode(object): self._draw_format_bits(mask) # Overwrite old format bits self._apply_mask(mask) # Apply the final choice of mask self._mask = mask + del self._isfunction diff --git a/typescript/qrcodegen.ts b/typescript/qrcodegen.ts index fbe04ad..52d8cec 100644 --- a/typescript/qrcodegen.ts +++ b/typescript/qrcodegen.ts @@ -181,7 +181,7 @@ namespace qrcodegen { let allCodewords: Array = this.addEccAndInterleave(dataCodewords); this.drawCodewords(allCodewords); - // Handle masking + // Do masking if (mask == -1) { // Automatically choose best mask let minPenalty: int = 1000000000; for (let i = 0; i < 8; i++) { @@ -200,6 +200,7 @@ namespace qrcodegen { this.mask = mask; this.drawFormatBits(mask); // Overwrite old format bits this.applyMask(mask); // Apply the final choice of mask + this.isFunction = []; }