diff options
author | Ben Woosley <[email protected]> | 2017-05-18 15:59:38 -0700 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2019-10-09 23:46:50 +0900 |
commit | bb71a128eb6e901d3d7deb895971a6706eb7110d (patch) | |
tree | 5a92d96b884a39c9101286bd59e97d8df6a71245 /gc.c | |
parent | 29e6782f5dbf127dc20156938af374eea9e2d74e (diff) |
Prefer st_is_member over st_lookup with 0
The st_is_member DEFINE has simpler semantics, for more readable code.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/1622
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3634,7 +3634,7 @@ cached_object_id(VALUE obj) while (1) { /* id is the object id */ - if (st_lookup(objspace->id_to_obj_tbl, (st_data_t)id, 0)) { + if (st_is_member(objspace->id_to_obj_tbl, (st_data_t)id)) { objspace->profile.object_id_collisions++; id += sizeof(VALUE); } @@ -7515,7 +7515,7 @@ gc_is_moveable_obj(rb_objspace_t *objspace, VALUE obj) case T_NODE: case T_CLASS: if (FL_TEST(obj, FL_FINALIZE)) { - if (st_lookup(finalizer_table, obj, 0)) { + if (st_is_member(finalizer_table, obj)) { return FALSE; } } |