| 210 | |
| 211 | |
| 212 | static PyObject * |
| 213 | BPlusTree_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 | |
| 237 | static PyObject * |
| 238 | BPlusTree_keys(BPlusTree *self, PyObject *Py_UNUSED(ignored)) { |
no test coverage detected