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

Remove op clone #22

Closed
jacwright opened this issue Apr 6, 2018 · 2 comments
Closed

Remove op clone #22

jacwright opened this issue Apr 6, 2018 · 2 comments

Comments

@jacwright
Copy link

I'm wondering why https://github.com/quilljs/delta/blob/master/lib/delta.js#L49 line (and the deep clone dependency) is needed and if it ought to be removed for better performance. I've not seen performance issues but saw this and thought it was unnecessary. Thoughts?

@jhchen
Copy link
Member

jhchen commented Apr 6, 2018

It possibly modifies two lines after the pasted line so would not be a benign change to not clone it first. It is also used in op.js for similar reasons.

@jacwright
Copy link
Author

Was just thinking that all the methods that use push are creating new objects, so it is unnecessary there. But if push is being used outside of the class (it is publicly available after all) then probably best not to treat it as immutable.

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

No branches or pull requests

2 participants