~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_btree_serializer_pyx.pyx

Get Keys into the btree implementation.
At the moment, it is used for the ref-lists, rather than being
used for the keys themselves. This is because we don't have 'depth'
information, so we don't know that a given Keys instance should
be considered a singular Key.
I'll probably hack together 'depth' support, rather than have a
Key type, though either would be reasonable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
    Py_DECREF_ptr(py_str)
95
95
    return result
96
96
 
 
97
from bzrlib import _keys_type_c
 
98
 
97
99
 
98
100
cdef class BTreeLeafParser:
99
101
    """Parse the leaf nodes of a BTree index.
250
252
                    if temp_ptr == NULL:
251
253
                        # key runs to the end
252
254
                        temp_ptr = ref_ptr
253
 
                    PyList_Append(ref_list, self.extract_key(temp_ptr))
254
 
                PyList_Append(ref_lists, tuple(ref_list))
 
255
                    ref_list.extend(self.extract_key(temp_ptr))
 
256
                ref_list = _keys_type_c.Keys(self.key_length, *ref_list)
 
257
                PyList_Append(ref_lists, ref_list)
255
258
                # prepare for the next reference list
256
259
                self._start = next_start
257
260
            ref_lists = tuple(ref_lists)