зеркало из https://github.com/github/ruby.git
* vm_insnhelper.c (vm_get_cvar_base): reduce duplicated checks and
move a warning outside the loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3a902c4dbd
Коммит
f957673826
|
@ -1,3 +1,8 @@
|
|||
Tue Sep 20 18:08:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_insnhelper.c (vm_get_cvar_base): reduce duplicated checks and
|
||||
move a warning outside the loop.
|
||||
|
||||
Mon Sep 19 18:55:51 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
|
||||
|
||||
* lib/fileutils.rb (module FileUtils): improve performance of
|
||||
|
|
|
@ -1235,14 +1235,17 @@ vm_get_cvar_base(NODE *cref)
|
|||
{
|
||||
VALUE klass;
|
||||
|
||||
while (cref && cref->nd_next &&
|
||||
if (!cref) {
|
||||
rb_bug("vm_get_cvar_base: no cref");
|
||||
}
|
||||
|
||||
while (cref->nd_next &&
|
||||
(NIL_P(cref->nd_clss) || FL_TEST(cref->nd_clss, FL_SINGLETON) ||
|
||||
(cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL))) {
|
||||
cref = cref->nd_next;
|
||||
|
||||
if (!cref->nd_next) {
|
||||
rb_warn("class variable access from toplevel");
|
||||
}
|
||||
}
|
||||
if (!cref->nd_next) {
|
||||
rb_warn("class variable access from toplevel");
|
||||
}
|
||||
|
||||
klass = cref->nd_clss;
|
||||
|
|
Загрузка…
Ссылка в новой задаче