Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve unwind performance and maintainability #288

Merged
merged 1 commit into from
Apr 16, 2018
Merged

Improve unwind performance and maintainability #288

merged 1 commit into from
Apr 16, 2018

Conversation

juanjoDiaz
Copy link
Collaborator

I wasn't 100% done with #286.

This PR makes the code more readable and also more performant :)

? lodashCloneDeep(o)
: Object.assign({}, o);
}
const clone = unwindPath.indexOf('.') !== -1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executed once instead of once for each element.

);
parentKeys.forEach(key => (clonedRow[key] = null));
}
const clonedRow = (this.opts.unwindBlank && index > 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for cloning, looping and deleting here

@coveralls
Copy link

coveralls commented Apr 16, 2018

Coverage Status

Coverage decreased (-0.1%) to 85.209% when pulling a10f6ce on juanjoDiaz:improve_unwind_refactor into d97a668 on zemirco:master.

@knownasilya
Copy link
Collaborator

knownasilya commented Apr 16, 2018

Hum, do we need another test?

Nvm, looks like arrow funcs/new lines aren't covered?

@knownasilya knownasilya merged commit 80e496d into zemirco:master Apr 16, 2018
@juanjoDiaz
Copy link
Collaborator Author

I don't think there is real coverage decrease. Must be just some mathematical glitch in the way the percentage is calculated.

At least I can't see which line is now uncovered and wasn't before ...

@juanjoDiaz juanjoDiaz deleted the improve_unwind_refactor branch April 29, 2019 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants