ruby-changes:66901
From: Nobuyoshi <ko1@a...>
Date: Tue, 27 Jul 2021 15:40:48 +0900 (JST)
Subject: [ruby-changes:66901] 6329da588b (master): Use predefined IDs
https://git.ruby-lang.org/ruby.git/commit/?id=6329da588b From 6329da588b5a27834e3a73c1e08bf54356033757 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 27 Jul 2021 09:20:24 +0900 Subject: Use predefined IDs --- object.c | 4 ++-- rational.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/object.c b/object.c index 49b955c..3211e57 100644 --- a/object.c +++ b/object.c @@ -477,7 +477,7 @@ mutable_obj_clone(VALUE obj, VALUE kwfreeze) https://github.com/ruby/ruby/blob/trunk/object.c#L477 if (!freeze_true_hash) { freeze_true_hash = rb_hash_new(); rb_gc_register_mark_object(freeze_true_hash); - rb_hash_aset(freeze_true_hash, ID2SYM(rb_intern("freeze")), Qtrue); + rb_hash_aset(freeze_true_hash, ID2SYM(idFreeze), Qtrue); rb_obj_freeze(freeze_true_hash); } @@ -493,7 +493,7 @@ mutable_obj_clone(VALUE obj, VALUE kwfreeze) https://github.com/ruby/ruby/blob/trunk/object.c#L493 if (!freeze_false_hash) { freeze_false_hash = rb_hash_new(); rb_gc_register_mark_object(freeze_false_hash); - rb_hash_aset(freeze_false_hash, ID2SYM(rb_intern("freeze")), Qfalse); + rb_hash_aset(freeze_false_hash, ID2SYM(idFreeze), Qfalse); rb_obj_freeze(freeze_false_hash); } diff --git a/rational.c b/rational.c index 846e8bd..76a4264 100644 --- a/rational.c +++ b/rational.c @@ -1043,7 +1043,7 @@ rb_rational_pow(VALUE self, VALUE other) https://github.com/ruby/ruby/blob/trunk/rational.c#L1043 return rb_float_pow(nurat_to_f(self), other); } else { - return rb_num_coerce_bin(self, other, rb_intern("**")); + return rb_num_coerce_bin(self, other, idPow); } } #define nurat_expt rb_rational_pow @@ -1102,7 +1102,7 @@ rb_rational_cmp(VALUE self, VALUE other) https://github.com/ruby/ruby/blob/trunk/rational.c#L1102 return rb_dbl_cmp(nurat_to_double(self), RFLOAT_VALUE(other)); default: - return rb_num_coerce_cmp(self, other, rb_intern("<=>")); + return rb_num_coerce_cmp(self, other, idCmp); } } -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/