- xbt_dynar_cursor_step(cursor->keys, &cursor->pos);
- xbt_dynar_cursor_step(cursor->key_lens, &cursor->pos_len);
+ current = cursor->current;
+ line = cursor->line;
+
+ if (cursor->dict != NULL) {
+ if (current != NULL) {
+ XBT_CDEBUG(xbt_dict_cursor, "current is not null, take the next element");
+ current = current->next;
+ XBT_CDEBUG(xbt_dict_cursor, "next element: %p", current);
+ }
+
+ while (current == NULL && (line + 1) <= cursor->dict->table_size) {
+ line++;
+ XBT_CDEBUG(xbt_dict_cursor, "current is NULL, take the next line");
+ current = cursor->dict->table[line];
+ XBT_CDEBUG(xbt_dict_cursor, "element in the next line: %p", current);
+ }
+ XBT_CDEBUG(xbt_dict_cursor, "search finished, current = %p, line = %d", current, line);
+
+ cursor->current = current;
+ cursor->line = line;
+ }