-void
-gras_dict_cursor_step(gras_dict_cursor_t cursor) {
- gras_assert(cursor);
-
- gras_dynar_cursor_step(cursor->keys, &cursor->pos);
- gras_dynar_cursor_step(cursor->key_lens, &cursor->pos_len);
+XBT_INLINE void xbt_dict_cursor_step(xbt_dict_cursor_t cursor)
+{
+ xbt_dictelm_t current;
+ int line;
+
+ XBT_DEBUG("xbt_dict_cursor_step");
+ xbt_assert(cursor);
+
+ current = cursor->current;
+ line = cursor->line;
+
+ if (cursor->dict != NULL) {
+
+ if (current != NULL) {
+ XBT_DEBUG("current is not null, take the next element");
+ current = current->next;
+ XBT_DEBUG("next element: %p", current);
+ }
+
+ while (current == NULL && ++line <= cursor->dict->table_size) {
+ XBT_DEBUG("current is NULL, take the next line");
+ current = cursor->dict->table[line];
+ XBT_DEBUG("element in the next line: %p", current);
+ }
+ XBT_DEBUG("search finished, current = %p, line = %d", current, line);
+
+ cursor->current = current;
+ cursor->line = line;
+ }