Skip to content

Commit

Permalink
Use rb_hash_foreach in coverage
Browse files Browse the repository at this point in the history
Using RHASH_TBL_RAW is a private API, so we should use rb_hash_foreach
rather than RHASH_TBL_RAW with st_foreach.
  • Loading branch information
peterzhu2118 committed Feb 23, 2024
1 parent ea2fb74 commit 6bd3e8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/coverage/coverage.c
Expand Up @@ -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);
Expand Down

0 comments on commit 6bd3e8f

Please sign in to comment.