diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-10-03 07:52:03 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-10-03 07:52:03 +0900 |
| commit | 306f02117b81620568548172bfc8ec85e1c653a2 (patch) | |
| tree | 060e361c280f113514f3e2e1eec8f7a0462368ae | |
| parent | a406a35cf87e8d0d8cf8809c712e54973b133a55 (diff) | |
| download | mruby-306f02117b81620568548172bfc8ec85e1c653a2.tar.gz mruby-306f02117b81620568548172bfc8ec85e1c653a2.zip | |
Refactor `append_gen` function.
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index b2c31ed17..4abe1c506 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -202,12 +202,11 @@ append_gen(parser_state *p, node *a, node *b) node *c = a; if (!a) return b; + if (!b) return a; while (c->cdr) { c = c->cdr; } - if (b) { - c->cdr = b; - } + c->cdr = b; return a; } #define append(a,b) append_gen(p,(a),(b)) |
