I've removed the line:
length = ord(offset[0]) + (ord(offset[1]) << 8)... as it throws a type error.
TypeError: 'int' object has no attribute 'getitem'
This could be changed to ord(data[offset:offset+4][0]) or create a temp
var to parse through, but the original implementation using bytes_to_int looks cleaner.
Once I have some time I'll look at the performance gains cited in the original fix and add a few samples in tests.
I've removed the line: length = ord(offset[0]) + (ord(offset[1]) << 8)... as it throws a type error.
TypeError: 'int' object has no attribute 'getitem'
This could be changed to ord(data[offset:offset+4][0]) or create a temp var to parse through, but the original implementation using bytes_to_int looks cleaner.
Once I have some time I'll look at the performance gains cited in the original fix and add a few samples in tests.