diff options
author | John Hawthorn <john@hawthorn.email> | 2019-12-12 16:42:34 -0800 |
---|---|---|
committer | Aaron Patterson <tenderlove@github.com> | 2019-12-17 09:19:00 -0800 |
commit | 8e56d3a6ab7cc05be586010acd9f85384d53403a (patch) | |
tree | 854e62a9904c1d8521cd7affb8deb4040104bf71 /vm_method.c | |
parent | d7a50a5cc694ab28608a9d5a2e39c2766330ffe6 (diff) |
Define PREV_CLASS_SERIAL
Avoids genereating a "throwaway" sentinel class serial. There wasn't any
read harm in doing so (we're at no risk of exhaustion and there'd be no
measurable performance impact), but if feels cleaner that all class
serials actually end up assigned and used (especially now that we won't
overwrite them in a single method definition).
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 2e948144d6..90ed0ba5f7 100644 --- a/vm_method.c +++ b/vm_method.c @@ -104,7 +104,7 @@ rb_clear_method_cache_by_class(VALUE klass) INC_GLOBAL_METHOD_STATE(); } else { - rb_serial_t old_serial = rb_next_class_serial(); + rb_serial_t old_serial = PREV_CLASS_SERIAL(); rb_class_clear_method_cache(klass, (VALUE)&old_serial); } } |