| 240 | } |
| 241 | |
| 242 | static PyObject * |
| 243 | BPlusTree_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 */ |
nothing calls this directly
no test coverage detected