summaryrefslogtreecommitdiff
path: root/weakmap.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-01-30 14:48:59 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-01-30 14:48:59 +0900
commit361b3efe164bd753258c7a86aff5141f1fd3ecf6 (patch)
tree1db3c279926bddcc6310e26413997c583d594a60 /weakmap.c
parent03246171cc1a506b5e03c9141337ef4f5a1f0856 (diff)
Use `UNDEF_P`
Diffstat (limited to 'weakmap.c')
-rw-r--r--weakmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/weakmap.c b/weakmap.c
index 7125c1707a..155312f1d4 100644
--- a/weakmap.c
+++ b/weakmap.c
@@ -772,7 +772,7 @@ static VALUE
wkmap_aref(VALUE self, VALUE key)
{
VALUE obj = wkmap_lookup(self, key);
- return obj != Qundef ? obj : Qnil;
+ return !UNDEF_P(obj) ? obj : Qnil;
}
struct wkmap_aset_args {
@@ -927,7 +927,7 @@ wkmap_getkey(VALUE self, VALUE key)
static VALUE
wkmap_has_key(VALUE self, VALUE key)
{
- return RBOOL(wkmap_lookup(self, key) != Qundef);
+ return RBOOL(!UNDEF_P(wkmap_lookup(self, key)));
}
/*