Turned recur
into int
[Feature #15777]
This commit is contained in:
parent
fb85a42860
commit
5b7cc63d11
@ -2200,7 +2200,7 @@ VALUE rb_search_class_path(VALUE);
|
|||||||
VALUE rb_attr_delete(VALUE, ID);
|
VALUE rb_attr_delete(VALUE, ID);
|
||||||
VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef);
|
VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef);
|
||||||
void rb_autoload_str(VALUE mod, ID id, VALUE file);
|
void rb_autoload_str(VALUE mod, ID id, VALUE file);
|
||||||
VALUE rb_autoload_at_p(VALUE, ID, VALUE);
|
VALUE rb_autoload_at_p(VALUE, ID, int);
|
||||||
void rb_deprecate_constant(VALUE mod, const char *name);
|
void rb_deprecate_constant(VALUE mod, const char *name);
|
||||||
NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
|
NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
|
||||||
rb_gvar_getter_t *rb_gvar_getter_function_of(const struct rb_global_entry *);
|
rb_gvar_getter_t *rb_gvar_getter_function_of(const struct rb_global_entry *);
|
||||||
|
3
load.c
3
load.c
@ -1169,9 +1169,8 @@ rb_mod_autoload(VALUE mod, VALUE sym, VALUE file)
|
|||||||
static VALUE
|
static VALUE
|
||||||
rb_mod_autoload_p(int argc, VALUE *argv, VALUE mod)
|
rb_mod_autoload_p(int argc, VALUE *argv, VALUE mod)
|
||||||
{
|
{
|
||||||
rb_check_arity(argc, 1, 2);
|
int recur = (rb_check_arity(argc, 1, 2) == 1) ? TRUE : RTEST(argv[1]);
|
||||||
VALUE sym = argv[0];
|
VALUE sym = argv[0];
|
||||||
VALUE recur = (argc == 1) ? Qtrue : argv[1];
|
|
||||||
|
|
||||||
ID id = rb_check_id(&sym);
|
ID id = rb_check_id(&sym);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
|
@ -2332,17 +2332,17 @@ rb_autoload_load(VALUE mod, ID id)
|
|||||||
VALUE
|
VALUE
|
||||||
rb_autoload_p(VALUE mod, ID id)
|
rb_autoload_p(VALUE mod, ID id)
|
||||||
{
|
{
|
||||||
return rb_autoload_at_p(mod, id, Qtrue);
|
return rb_autoload_at_p(mod, id, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_autoload_at_p(VALUE mod, ID id, VALUE recur)
|
rb_autoload_at_p(VALUE mod, ID id, int recur)
|
||||||
{
|
{
|
||||||
VALUE load;
|
VALUE load;
|
||||||
struct autoload_data_i *ele;
|
struct autoload_data_i *ele;
|
||||||
|
|
||||||
while (!autoload_defined_p(mod, id)) {
|
while (!autoload_defined_p(mod, id)) {
|
||||||
if (!RTEST(recur)) return Qnil;
|
if (!recur) return Qnil;
|
||||||
mod = RCLASS_SUPER(mod);
|
mod = RCLASS_SUPER(mod);
|
||||||
if (!mod) return Qnil;
|
if (!mod) return Qnil;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user