One function

DataStream in ricklupton/rmc

The author described this change as Fix varint serialisation. It counts as a record because the check below fails on the code as it stood at 0da68ba96 and passes on ece14a5ad, with nothing else changed between the two runs.

Fix saved2023-01-12
Sharing licenceMIT · LICENSE
Change size+7 3

What the code was meant to do, written into the code itself as a docstring

Read basic values from a remarkable v6 file stream.

The change

181181
182182 def write_varuint(self, value: int):
183183 """Write a varuint to the data stream."""
184- while value:
184+ b = bytearray()
185+ while True:
185186 to_write = value & 0x7F
186187 value >>= 7
187188 if value:
188- to_write |= 0x80
189- self.data.write(bytes((to_write,)))
189+ b.append(to_write | 0x80)
190+ else:
191+ b.append(to_write)
192+ break
193+ self.data.write(b)

The check that tells the two apart

failpass·tests/test_basic_data_stream.py::test_write_varuint[0-00]

Check file tests/test_basic_data_stream.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it0da68ba965eb94e367724d60c073988e21c1e1c7
Broken version dated2023-01-12
Modulermscene.tagged_block_common
Units changedDataStream
Fingerprint70f577d13c279d97
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.