зеркало из https://github.com/github/ruby.git
Rename labels in `Check_Type` more descriptive
This commit is contained in:
Родитель
9f88135f78
Коммит
d58620e0a1
|
@ -337,25 +337,19 @@ static inline void
|
||||||
Check_Type(VALUE v, enum ruby_value_type t)
|
Check_Type(VALUE v, enum ruby_value_type t)
|
||||||
{
|
{
|
||||||
if (RB_UNLIKELY(! RB_TYPE_P(v, t))) {
|
if (RB_UNLIKELY(! RB_TYPE_P(v, t))) {
|
||||||
goto slowpath;
|
goto unexpected_type;
|
||||||
}
|
}
|
||||||
else if (t != RUBY_T_DATA) {
|
else if (t == RUBY_T_DATA && rbimpl_rtypeddata_p(v)) {
|
||||||
goto fastpath;
|
|
||||||
}
|
|
||||||
else if (rbimpl_rtypeddata_p(v)) {
|
|
||||||
/* The intention itself is not necessarily clear to me, but at least it
|
/* The intention itself is not necessarily clear to me, but at least it
|
||||||
* is intentional to rule out typed data here. See commit
|
* is intentional to rule out typed data here. See commit
|
||||||
* a7c32bf81d3391cfb78cfda278f469717d0fb794. */
|
* a7c32bf81d3391cfb78cfda278f469717d0fb794. */
|
||||||
goto slowpath;
|
goto unexpected_type;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goto fastpath;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fastpath:
|
unexpected_type:
|
||||||
return;
|
|
||||||
|
|
||||||
slowpath: /* <- :TODO: mark this label as cold. */
|
|
||||||
rb_unexpected_type(v, t);
|
rb_unexpected_type(v, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче