Added and updated miscellaneous comments.

This commit is contained in:
Project Nayuki 2018-10-05 00:23:28 +00:00
parent ac6ef8fe31
commit 00fb83d4d5
2 changed files with 4 additions and 1 deletions

View File

@ -162,7 +162,7 @@ class QrSegment final {
/*
* Creates a new QR Code data segment with the given parameters and data.
* Creates a new QR Code segment with the given parameters and data.
* The character count (numCh) must agree with the mode and the bit buffer length,
* but the constraint isn't checked. The given bit buffer is moved and stored.
*/

View File

@ -685,6 +685,8 @@ class QrSegment(object):
raise TypeError("QrSegment.Mode expected")
if numch < 0:
raise ValueError()
# The mode indicator for this segment.
self._mode = mode
# The length of this segment's unencoded data, measured in characters for
@ -692,6 +694,7 @@ class QrSegment(object):
# Always zero or positive.
self._numchars = numch
# The data bits of this segment. Accessed through get_bits().
self._bitdata = list(bitdata) # Make defensive copy