diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-10-05 18:50:55 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-10-05 18:50:55 +0900 |
| commit | 9295f6ae4916854c92cd3430cd0ee5d3b2f1b2df (patch) | |
| tree | 643fdbecffd61aa7194ae5286e5a3b4fdb8fb849 /src | |
| parent | 250b62d9255df044a8f0695159d86219a07d2788 (diff) | |
| download | mruby-9295f6ae4916854c92cd3430cd0ee5d3b2f1b2df.tar.gz mruby-9295f6ae4916854c92cd3430cd0ee5d3b2f1b2df.zip | |
simplify stack_clear()
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -75,7 +75,12 @@ stack_clear(mrb_value *from, size_t count) const mrb_value mrb_value_zero = { { 0 } }; while (count-- > 0) { +#ifndef MRB_NAN_BOXING *from++ = mrb_value_zero; +#else + SET_NIL_VALUE(*from); + from++; +#endif } } @@ -156,15 +161,7 @@ stack_extend(mrb_state *mrb, int room, int keep) } if (room > keep) { -#ifndef MRB_NAN_BOXING stack_clear(&(mrb->c->stack[keep]), room - keep); -#else - struct mrb_context *c = mrb->c; - int i; - for (i=keep; i<room; i++) { - SET_NIL_VALUE(c->stack[i]); - } -#endif } } |
