Show More
@@ -221,6 +221,11 b' class Block(dict):' | |||
|
221 | 221 | |
|
222 | 222 | contains up to 16 entry indexed from 0 to 15""" |
|
223 | 223 | |
|
224 | def __init__(self): | |
|
225 | super(Block, self).__init__() | |
|
226 | # If this block exist on disk, here is its ID | |
|
227 | self.ondisk_id = None | |
|
228 | ||
|
224 | 229 | def __iter__(self): |
|
225 | 230 | return iter(self.get(i) for i in range(16)) |
|
226 | 231 | |
@@ -323,8 +328,8 b' def parse_data(data):' | |||
|
323 | 328 | new_blocks = [] |
|
324 | 329 | for i in range(0, len(data), S_BLOCK.size): |
|
325 | 330 | block = Block() |
|
326 | ondisk_id = len(block_map) | |
|
327 | block_map[ondisk_id] = block | |
|
331 | block.ondisk_id = len(block_map) | |
|
332 | block_map[block.ondisk_id] = block | |
|
328 | 333 | block_data = data[i : i + S_BLOCK.size] |
|
329 | 334 | values = S_BLOCK.unpack(block_data) |
|
330 | 335 | new_blocks.append((block, values)) |
General Comments 0
You need to be logged in to leave comments.
Login now