Use rb_hash_foreach in coverage

Using RHASH_TBL_RAW is a private API, so we should use rb_hash_foreach
rather than RHASH_TBL_RAW with st_foreach.
This commit is contained in:
Peter Zhu 2024-02-22 17:02:36 -05:00
Родитель ea2fb7460e
Коммит 6bd3e8fbb2
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -353,7 +353,8 @@ rb_coverage_peek_result(VALUE klass)
rb_raise(rb_eRuntimeError, "coverage measurement is not enabled");
}
OBJ_WB_UNPROTECT(coverages);
st_foreach(RHASH_TBL_RAW(coverages), coverage_peek_result_i, ncoverages);
rb_hash_foreach(coverages, coverage_peek_result_i, ncoverages);
if (current_mode & COVERAGE_TARGET_METHODS) {
rb_objspace_each_objects(method_coverage_i, &ncoverages);