From 712dfb9f77de0bc57d1eeaea81538b7072a8ff6d Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Mon, 28 Aug 2017 01:06:43 +0000 Subject: [PATCH] Added comments in Python and Rust code. --- python/qrcodegen-demo.py | 2 ++ python/qrcodegen.py | 2 +- rust/src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/qrcodegen-demo.py b/python/qrcodegen-demo.py index f5ab865..86fc688 100644 --- a/python/qrcodegen-demo.py +++ b/python/qrcodegen-demo.py @@ -41,6 +41,8 @@ def do_basic_demo(): """Creates a single QR Code, then prints it to the console.""" text = u"Hello, world!" # User-supplied Unicode text errcorlvl = qrcodegen.QrCode.Ecc.LOW # Error correction level + + # Make and print the QR Code symbol qr = qrcodegen.QrCode.encode_text(text, errcorlvl) print_qr(qr) print(qr.to_svg_str(4)) diff --git a/python/qrcodegen.py b/python/qrcodegen.py index aefcd3a..61798a7 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -790,7 +790,7 @@ class _ReedSolomonGenerator(object): # drop the highest term, and store the rest of the coefficients in order of descending powers. # Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D). root = 1 - for _ in range(degree): + for _ in range(degree): # Unused variable i # Multiply the current product by (x - r^i) for j in range(degree): self.coefficients[j] = _ReedSolomonGenerator._multiply(self.coefficients[j], root) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 8287a7b..287b9f3 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -724,7 +724,7 @@ impl ReedSolomonGenerator { // drop the highest term, and store the rest of the coefficients in order of descending powers. // Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D). let mut root: u8 = 1; - for _ in 0 .. degree { + for _ in 0 .. degree { // Unused variable i // Multiply the current product by (x - r^i) for j in 0 .. degree { coefs[j] = ReedSolomonGenerator::multiply(coefs[j], root);