Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Johannes Müller <straightshoota@gmail.com>
  • Loading branch information
asterite and straight-shoota committed Oct 6, 2022
1 parent 5cc8f76 commit 5d0b521
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/compiler/crystal/semantic/normalizer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,7 @@ module Crystal
when Expressions
body.expressions = extra_expressions + body.expressions
else
new_expressions = Array(ASTNode).new(extra_expressions.size + 1)
new_expressions.concat(extra_expressions)
new_expressions.push(node.body)
new_expressions << node.body

node.body = Expressions.new(new_expressions).at(node.body)
end
Expand Down
3 changes: 1 addition & 2 deletions src/compiler/crystal/syntax/to_s.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,7 @@ module Crystal
case node
when Expressions
@str << "("
node.expressions.each_with_index do |exp, j|
@str << ", " if j > 0
node.expressions.join(@str, ", ") do |exp|
visit_unpack exp
end
@str << ")"
Expand Down

0 comments on commit 5d0b521

Please sign in to comment.