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

Function BPlusTree_items

python/bplustree_c_src/bplustree_module.c:242–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242static PyObject *
243BPlusTree_items(BPlusTree *self, PyObject *Py_UNUSED(args)) {
244 BPlusTreeIterator *iter = PyObject_New(BPlusTreeIterator, &BPlusTreeIteratorType);
245 if (!iter) return NULL;
246
247 Py_INCREF(self);
248 iter->tree = self;
249
250 /* Find the first leaf node by traversing from root */
251 BPlusNode *first_leaf = self->root;
252 if (first_leaf) {
253 while (first_leaf->type == NODE_BRANCH) {
254 first_leaf = node_get_child(first_leaf, 0);
255 if (!first_leaf) break;
256 }
257 }
258
259 iter->current_node = first_leaf;
260 iter->current_index = 0;
261 iter->include_values = 1;
262 iter->modification_count = self->modification_count;
263
264 return (PyObject *)iter;
265}
266
267
268/* Method definitions */

Callers

nothing calls this directly

Calls 1

node_get_childFunction · 0.85

Tested by

no test coverage detected