From bb71a128eb6e901d3d7deb895971a6706eb7110d Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Thu, 18 May 2017 15:59:38 -0700 Subject: Prefer st_is_member over st_lookup with 0 The st_is_member DEFINE has simpler semantics, for more readable code. --- variable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'variable.c') 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: -- cgit v1.2.3