summaryrefslogtreecommitdiff
path: root/class.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 /class.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 'class.c')
-rw-r--r--class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/class.c b/class.c
index b4aeb59..09afc72 100644
--- a/class.c
+++ b/class.c
@@ -1176,7 +1176,7 @@ method_entry_i(ID key, VALUE value, void *data)
if (!me) return ID_TABLE_CONTINUE;
if (!arg->recur && me->owner != owner) return ID_TABLE_CONTINUE;
}
- if (!st_lookup(arg->list, key, 0)) {
+ if (!st_is_member(arg->list, key)) {
if (UNDEFINED_METHOD_ENTRY_P(me)) {
type = METHOD_VISI_UNDEF; /* none */
}