ruby-changes:55036
From: nobu <ko1@a...>
Date: Wed, 13 Mar 2019 10:44:44 +0900 (JST)
Subject: [ruby-changes:55036] nobu:r67243 (trunk): Remove unnecessary local variable
nobu 2019-03-13 10:44:34 +0900 (Wed, 13 Mar 2019) New Revision: 67243 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67243 Log: Remove unnecessary local variable newline is always "\n" when it is used. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 67242) +++ parse.y (revision 67243) @@ -4666,7 +4666,7 @@ parser_yyerror(struct parser_params *p, https://github.com/ruby/ruby/blob/trunk/parse.y#L4666 const int max_line_margin = 30; const char *ptr, *ptr_end, *pt, *pb; const char *pre = "", *post = "", *pend; - const char *code = "", *caret = "", *newline = ""; + const char *code = "", *caret = ""; const char *lim; char *buf; long len; @@ -4757,10 +4757,9 @@ parser_yyerror(struct parser_params *p, https://github.com/ruby/ruby/blob/trunk/parse.y#L4757 p2 += (lim - ptr); } *p2 = '\0'; - newline = "\n"; - compile_error(p, "%s%s""%s%.*s%s%s""%s%s", - msg, newline, - pre, (int)len, code, post, newline, + compile_error(p, "%s\n""%s%.*s%s\n""%s%s", + msg, + pre, (int)len, code, post, pre, caret); } #else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/