ruby-changes:49731
From: mame <ko1@a...>
Date: Mon, 15 Jan 2018 16:54:29 +0900 (JST)
Subject: [ruby-changes:49731] mame:r61848 (trunk): parse.y: Remove unneeded NULL check
mame 2018-01-15 16:54:24 +0900 (Mon, 15 Jan 2018) New Revision: 61848 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61848 Log: parse.y: Remove unneeded NULL check There are many usages assuming that bodystmt always returns non-null. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61847) +++ parse.y (revision 61848) @@ -2378,13 +2378,8 @@ primary : literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2378 { CMDARG_SET($<val>1); /*%%%*/ - if ($3 == NULL) { - $$ = NEW_NIL(&@$); - } - else { - set_line_body($3, @1.end_pos.lineno); - $$ = NEW_BEGIN($3, &@$); - } + set_line_body($3, @1.end_pos.lineno); + $$ = NEW_BEGIN($3, &@$); nd_set_line($$, @1.end_pos.lineno); /*% $$ = dispatch1(begin, $3); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/