Simplify concat

This commit is contained in:
Andre Medeiros 2018-09-26 11:47:02 -04:00
parent b1f9097824
commit 767687b297
1 changed files with 2 additions and 2 deletions

View File

@ -167,13 +167,13 @@ class ContractSource {
let trueExpression = (node.trueBody && node.trueBody.statements && node.trueBody.statements[0]) || node.trueBody; let trueExpression = (node.trueBody && node.trueBody.statements && node.trueBody.statements[0]) || node.trueBody;
if(trueExpression) { if(trueExpression) {
children = children.concat([].concat(trueExpression)); children = children.concat(trueExpression);
trueExpression._parent = {type: 'b', id: node.id, idx: 0}; trueExpression._parent = {type: 'b', id: node.id, idx: 0};
} }
let falseExpression = (node.falseBody && node.falseBody.statements && node.falseBody.statements[0]) || node.falseBody; let falseExpression = (node.falseBody && node.falseBody.statements && node.falseBody.statements[0]) || node.falseBody;
if(falseExpression) { if(falseExpression) {
children = children.concat([].concat(falseExpression)); children = children.concat(falseExpression);
falseExpression._parent = {type: 'b', id: node.id, idx: 1}; falseExpression._parent = {type: 'b', id: node.id, idx: 1};
} }