Tweaked code slightly.

pull/39/merge
Project Nayuki 6 years ago
parent c7bc281e18
commit b7922a8dce

@ -173,7 +173,7 @@ public final class QrSegment {
* Always zero or positive. Not the same as the data's bit length. */ * Always zero or positive. Not the same as the data's bit length. */
public final int numChars; public final int numChars;
/** The data bits of this segment. Not {@code null}. Accessed through {@link getBits()}. */ /** The data bits of this segment. Not {@code null}. Accessed through {@link #getBits()}. */
final BitBuffer data; final BitBuffer data;

@ -808,7 +808,7 @@ namespace qrcodegen {
let ccbits: int = seg.mode.numCharCountBits(version); let ccbits: int = seg.mode.numCharCountBits(version);
if (seg.numChars >= (1 << ccbits)) if (seg.numChars >= (1 << ccbits))
return Infinity; // The segment's length doesn't fit the field's bit width return Infinity; // The segment's length doesn't fit the field's bit width
result += 4 + ccbits + seg.getBits().length; result += 4 + ccbits + seg.bitData.length;
} }
return result; return result;
} }

Loading…
Cancel
Save