equal
deleted
inserted
replaced
375 # mapping to read/write various marker formats |
375 # mapping to read/write various marker formats |
376 # <version> -> (decoder, encoder) |
376 # <version> -> (decoder, encoder) |
377 formats = {_fm0version: (_fm0readmarkers, _fm0encodeonemarker), |
377 formats = {_fm0version: (_fm0readmarkers, _fm0encodeonemarker), |
378 _fm1version: (_fm1readmarkers, _fm1encodeonemarker)} |
378 _fm1version: (_fm1readmarkers, _fm1encodeonemarker)} |
379 |
379 |
|
380 @util.nogc |
380 def _readmarkers(data): |
381 def _readmarkers(data): |
381 """Read and enumerate markers from raw data""" |
382 """Read and enumerate markers from raw data""" |
382 off = 0 |
383 off = 0 |
383 diskversion = _unpack('>B', data[off:off + 1])[0] |
384 diskversion = _unpack('>B', data[off:off + 1])[0] |
384 off += 1 |
385 off += 1 |
560 |
561 |
561 Returns the number of new markers added.""" |
562 Returns the number of new markers added.""" |
562 version, markers = _readmarkers(data) |
563 version, markers = _readmarkers(data) |
563 return self.add(transaction, markers) |
564 return self.add(transaction, markers) |
564 |
565 |
|
566 @util.nogc |
565 def _load(self, markers): |
567 def _load(self, markers): |
566 for mark in markers: |
568 for mark in markers: |
567 self._all.append(mark) |
569 self._all.append(mark) |
568 pre, sucs = mark[:2] |
570 pre, sucs = mark[:2] |
569 self.successors.setdefault(pre, set()).add(mark) |
571 self.successors.setdefault(pre, set()).add(mark) |