diff options
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -2238,4 +2238,19 @@ rb_hash_bulk_insert_into_st_table(long argc, const VALUE *argv, VALUE hash) else st_insert_generic(tab, argc, argv, hash); } + +// to iterate iv_index_tbl +st_data_t +rb_st_nth_key(st_table *tab, st_index_t index) +{ + if (LIKELY(tab->entries_start == 0 && + tab->num_entries == tab->entries_bound && + index < tab->num_entries)) { + return tab->entries[index].key; + } + else { + rb_bug("unreachable"); + } +} + #endif |