зеркало из https://github.com/github/ruby.git
Refactor RB_SPECIAL_CONST_P (#6759)
Since https://github.com/ruby/ruby/pull/6599, RUBY_IMMEDIATE_MASK also overlaps RUBY_Qnil. Now RB_SPECIAL_CONST_P seems confusing since both RB_IMMEDIATE_P and RB_TEST check for RUBY_Qnil while we only need to check RUBY_Qnil besides RUBY_IMMEDIATE_MASK. I'd like to make this change to make it less confusing. I confirmed that this doesn't change the number of instructions used for the RUBY_Qfalse check on Linux x86_64 GCC and macOS arm64 Clang.
This commit is contained in:
Родитель
d8202a52a5
Коммит
ab4379e086
|
@ -326,7 +326,7 @@ RBIMPL_ATTR_ARTIFICIAL()
|
|||
static inline bool
|
||||
RB_SPECIAL_CONST_P(VALUE obj)
|
||||
{
|
||||
return RB_IMMEDIATE_P(obj) || ! RB_TEST(obj);
|
||||
return RB_IMMEDIATE_P(obj) || obj == RUBY_Qfalse;
|
||||
}
|
||||
|
||||
RBIMPL_ATTR_CONST()
|
||||
|
|
Загрузка…
Ссылка в новой задаче