diff options
author | John Hawthorn <john@hawthorn.email> | 2019-12-11 15:47:49 -0800 |
---|---|---|
committer | Aaron Patterson <tenderlove@github.com> | 2019-12-17 09:19:00 -0800 |
commit | a01d22b8c16d9bd44767cced8d45398493af0a7c (patch) | |
tree | 03c3016f66bdfc6cb481752f7edcdb0647616d10 /vm_method.c | |
parent | 8e56d3a6ab7cc05be586010acd9f85384d53403a (diff) |
Check type with BUILTIN_TYPE in method cache clear
We know that this is a heap-allocated object (a CLASS, MODULE, or
ICLASS) so we don't need to check if it is an immediate value. This
should be very slightly faster.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2752
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c index 90ed0ba5f7..2f1817a9ea 100644 --- a/vm_method.c +++ b/vm_method.c @@ -70,7 +70,7 @@ rb_class_clear_method_cache(VALUE klass, VALUE arg) mjit_remove_class_serial(RCLASS_SERIAL(klass)); RCLASS_SERIAL(klass) = rb_next_class_serial(); - if (RB_TYPE_P(klass, T_ICLASS)) { + if (BUILTIN_TYPE(klass) == T_ICLASS) { struct rb_id_table *table = RCLASS_CALLABLE_M_TBL(klass); if (table) { rb_id_table_clear(table); |