summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2017-05-18 15:59:38 -0700
committer卜部昌平 <shyouhei@ruby-lang.org>2019-10-09 23:46:50 +0900
commitbb71a128eb6e901d3d7deb895971a6706eb7110d (patch)
tree5a92d96b884a39c9101286bd59e97d8df6a71245 /variable.c
parent29e6782f5dbf127dc20156938af374eea9e2d74e (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 'variable.c')
-rw-r--r--variable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index aafb6f4725..b0f87923d4 100644
--- a/variable.c
+++ b/variable.c
@@ -1335,7 +1335,7 @@ rb_ivar_defined(VALUE obj, ID id)
break;
case T_CLASS:
case T_MODULE:
- if (RCLASS_IV_TBL(obj) && st_lookup(RCLASS_IV_TBL(obj), (st_data_t)id, 0))
+ if (RCLASS_IV_TBL(obj) && st_is_member(RCLASS_IV_TBL(obj), (st_data_t)id))
return Qtrue;
break;
default: