Added a comment in Java QrSegmentAdvanced.makeSegmentsOptimally() functions to be consistent with QrCode.encodeSegments().

This commit is contained in:
Project Nayuki 2022-01-07 06:04:32 +00:00
parent daa3114dcf
commit 9e81969139
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ public final class QrSegmentAdvanced {
assert segs != null; assert segs != null;
// Check if the segments fit // Check if the segments fit
int dataCapacityBits = QrCode.getNumDataCodewords(version, ecl) * 8; int dataCapacityBits = QrCode.getNumDataCodewords(version, ecl) * 8; // Number of data bits available
int dataUsedBits = QrSegment.getTotalBits(segs, version); int dataUsedBits = QrSegment.getTotalBits(segs, version);
if (dataUsedBits != -1 && dataUsedBits <= dataCapacityBits) if (dataUsedBits != -1 && dataUsedBits <= dataCapacityBits)
return segs; // This version number is found to be suitable return segs; // This version number is found to be suitable

View File

@ -76,7 +76,7 @@ public final class QrSegmentAdvanced {
assert segs != null; assert segs != null;
// Check if the segments fit // Check if the segments fit
int dataCapacityBits = QrCode.getNumDataCodewords(version, ecl) * 8; int dataCapacityBits = QrCode.getNumDataCodewords(version, ecl) * 8; // Number of data bits available
int dataUsedBits = QrSegment.getTotalBits(segs, version); int dataUsedBits = QrSegment.getTotalBits(segs, version);
if (dataUsedBits != -1 && dataUsedBits <= dataCapacityBits) if (dataUsedBits != -1 && dataUsedBits <= dataCapacityBits)
return segs; // This version number is found to be suitable return segs; // This version number is found to be suitable