1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

load.c: use rb_warning directly

This removes the last dependency on rb_mWarning outside of
error.c and allows future commits to mark it static.

Yes, I expect this to slow down the emitting of a warning
message in a cold code path slightly :P

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-01-20 22:07:36 +00:00
parent 8a489a7d6f
commit 903b6628de

4
load.c
View file

@ -715,8 +715,6 @@ rb_f_load(int argc, VALUE *argv)
return Qtrue;
}
extern VALUE rb_mWarning;
static char *
load_lock(const char *ftptr)
{
@ -741,7 +739,7 @@ load_lock(const char *ftptr)
if (RTEST(ruby_verbose)) {
VALUE warning = rb_warning_string("loading in progress, circular require considered harmful - %s", ftptr);
rb_backtrace_each(rb_str_append, warning);
rb_warning_warn(rb_mWarning, warning);
rb_warning("%"PRIsVALUE, warning);
}
switch (rb_thread_shield_wait((VALUE)data)) {
case Qfalse: