MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / resize

Method resize

projects/Python/proto/fbe.py:1601–1611  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

1599
1600 # Resize the set and get its first model
1601 def resize(self, size):
1602 fbe_set_size = size * self._model.fbe_size
1603 fbe_set_offset = self._buffer.allocate(4 + fbe_set_size) - self._buffer.offset
1604 assert ((fbe_set_offset > 0) and ((self._buffer.offset + fbe_set_offset + 4) <= self._buffer.size)), "Model is broken!"
1605
1606 self.write_uint32(self.fbe_offset, fbe_set_offset)
1607 self.write_uint32(fbe_set_offset, size)
1608 self.write_count(fbe_set_offset + 4, 0, fbe_set_size)
1609
1610 self._model.fbe_offset = fbe_set_offset + 4
1611 return self._model
1612
1613 # Check if the set value is valid
1614 def verify(self):

Callers 1

setMethod · 0.95

Calls 3

allocateMethod · 0.45
write_uint32Method · 0.45
write_countMethod · 0.45

Tested by

no test coverage detected