mirror of
https://github.com/status-im/QR-Code-generator.git
synced 2026-08-27 15:51:17 +00:00
Reformatted a comment in all language versions (related to commit 5073db4487).
This commit is contained in:
+1
-2
@@ -476,8 +476,7 @@ class QrCode(object):
|
||||
|
||||
# Balance of black and white modules
|
||||
black = sum((1 if cell else 0) for row in modules for cell in row)
|
||||
# Note that size is odd, so black/total != 1/2
|
||||
total = size**2
|
||||
total = size**2 # Note that size is odd, so black/total != 1/2
|
||||
# Compute the smallest integer k >= 0 such that (45-5k)% <= black/total <= (55+5k)%
|
||||
k = (abs(black * 20 - total * 10) + total - 1) // total - 1
|
||||
result += k * QrCode._PENALTY_N4
|
||||
|
||||
Reference in New Issue
Block a user