Skip to content

Commit

Permalink
[Refactor] parse: only need to reassign the var once
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed May 13, 2018
1 parent eaabd05 commit 1bfe04c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ var parseObject = function (chain, val, options) {
var root = chain[i];

if (root === '[]') {
obj = [];
obj = obj.concat(leaf);
obj = [].concat(leaf);
} else {
obj = options.plainObjects ? Object.create(null) : {};
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
Expand Down

0 comments on commit 1bfe04c

Please sign in to comment.