mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-fiber (fiber_switch): reduce the scope of local variables
This commit is contained in:
@@ -252,8 +252,6 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
|
||||
}
|
||||
fiber_switch_context(mrb, c);
|
||||
if (status == MRB_FIBER_CREATED) {
|
||||
mrb_value *b, *e;
|
||||
|
||||
if (!c->ci->proc) {
|
||||
return fiber_error(mrb, "double resume (current)");
|
||||
}
|
||||
@@ -267,8 +265,10 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
|
||||
}
|
||||
else {
|
||||
mrb_stack_extend(mrb, len+2); /* for receiver and (optional) block */
|
||||
b = c->stbase+1;
|
||||
e = b + len;
|
||||
|
||||
mrb_value *b = c->stbase+1;
|
||||
mrb_value *e = b + len;
|
||||
|
||||
while (b<e) {
|
||||
*b++ = *a++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user