Tweaked TypeScript code to correspond with other implementations for ease of auditing, without changing behavior.

pull/118/head
Project Nayuki 3 years ago
parent 764749bd8a
commit 87db45ef9c

@ -545,7 +545,7 @@ namespace qrcodegen {
else { else {
const numAlign: int = Math.floor(this.version / 7) + 2; const numAlign: int = Math.floor(this.version / 7) + 2;
const step: int = (this.version == 32) ? 26 : const step: int = (this.version == 32) ? 26 :
Math.ceil((this.size - 13) / (numAlign * 2 - 2)) * 2; Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;
let result: Array<int> = [6]; let result: Array<int> = [6];
for (let pos = this.size - 7; result.length < numAlign; pos -= step) for (let pos = this.size - 7; result.length < numAlign; pos -= step)
result.splice(1, 0, pos); result.splice(1, 0, pos);

Loading…
Cancel
Save