Deleted comment and calculated the constant in QrCode.getNumRawDataModules() in all language versions except Java, because only the Java code explains the calculation in detail.

This commit is contained in:
Project Nayuki 2018-08-28 03:53:17 +00:00
parent f83f201b8d
commit e7d2449957
6 changed files with 6 additions and 6 deletions

View File

@ -253,7 +253,7 @@ testable int getNumRawDataModules(int version) {
int numAlign = version / 7 + 2;
result -= (25 * numAlign - 10) * numAlign - 55;
if (version >= 7)
result -= 18 * 2; // Subtract version information
result -= 36;
}
return result;
}

View File

@ -520,7 +520,7 @@ int QrCode::getNumRawDataModules(int ver) {
int numAlign = ver / 7 + 2;
result -= (25 * numAlign - 10) * numAlign - 55;
if (ver >= 7)
result -= 18 * 2; // Subtract version information
result -= 36;
}
return result;
}

View File

@ -628,7 +628,7 @@ var qrcodegen = new function() {
var numAlign = Math.floor(ver / 7) + 2;
result -= (25 * numAlign - 10) * numAlign - 55;
if (ver >= 7)
result -= 18 * 2; // Subtract version information
result -= 36;
}
return result;
};

View File

@ -515,7 +515,7 @@ class QrCode(object):
numalign = ver // 7 + 2
result -= (25 * numalign - 10) * numalign - 55
if ver >= 7:
result -= 18 * 2 # Subtract version information
result -= 36
return result

View File

@ -649,7 +649,7 @@ impl QrCode {
let numalign: usize = (ver as usize) / 7 + 2;
result -= (25 * numalign - 10) * numalign - 55;
if ver >= 7 {
result -= 18 * 2; // Subtract version information
result -= 36;
}
}
result

View File

@ -591,7 +591,7 @@ namespace qrcodegen {
let numAlign: int = Math.floor(ver / 7) + 2;
result -= (25 * numAlign - 10) * numAlign - 55;
if (ver >= 7)
result -= 18 * 2; // Subtract version information
result -= 36;
}
return result;
}