diff options
author | ydah <[email protected]> | 2024-11-11 23:22:36 +0900 |
---|---|---|
committer | Yudai Takada <[email protected]> | 2025-01-21 20:25:38 +0900 |
commit | 3260b0b6471ae0d7c31c1047550d8cc8afbfe63c (patch) | |
tree | cba248fd223b9c84bc15d8545d8e9f78c7a90105 | |
parent | 5d6f76cf6eea68749a761cf40c731f78fb17c2d9 (diff) |
Remove unnecessary assignments to local variables in `strings`
Local variables are not reassigned and are not needed.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12054
-rw-r--r-- | parse.y | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -5927,14 +5927,11 @@ literal : numeric strings : string { - NODE *node = $1; - if (!node) { - node = NEW_STR(STRING_NEW0(), &@$); + if (!$1) { + $$ = NEW_STR(STRING_NEW0(), &@$); + } else { + $$ = evstr2dstr(p, $1); } - else { - node = evstr2dstr(p, node); - } - $$ = node; /*% ripper: $:1 %*/ } ; |