MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / BPlusTree_iter

Function BPlusTree_iter

python/bplustree_c_src/bplustree_module.c:212–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210
211
212static PyObject *
213BPlusTree_iter(BPlusTree *self) {
214 BPlusTreeIterator *iter = PyObject_New(BPlusTreeIterator, &BPlusTreeIteratorType);
215 if (!iter) return NULL;
216
217 Py_INCREF(self);
218 iter->tree = self;
219
220 /* Find the first leaf node by traversing from root */
221 BPlusNode *first_leaf = self->root;
222 if (first_leaf) {
223 while (first_leaf->type == NODE_BRANCH) {
224 first_leaf = node_get_child(first_leaf, 0);
225 if (!first_leaf) break;
226 }
227 }
228
229 iter->current_node = first_leaf;
230 iter->current_index = 0;
231 iter->include_values = 0;
232 iter->modification_count = self->modification_count;
233
234 return (PyObject *)iter;
235}
236
237static PyObject *
238BPlusTree_keys(BPlusTree *self, PyObject *Py_UNUSED(ignored)) {

Callers 1

BPlusTree_keysFunction · 0.85

Calls 1

node_get_childFunction · 0.85

Tested by

no test coverage detected