Skip to content

Conversation

felvhage
Copy link
Contributor

This is a fix for #9546
It increases performance of cleanData as demonstrated here: http://jsfiddle.net/r7buw/17/

(Pull Request meta: second try)

  • CLA now signed
  • Code is now hopefully in line with the Style-guide
  • Improved method, so that it more specifically checks for the remove handler instead of just "events"
  • Created a new fork with a branch for commit

The cleanData-Method triggered "remove" on all elements in the tree.
After the fix the remove-handler will only be triggered if it exists.
Doing so increases performance significantly.
See performance-comparison http://jsfiddle.net/r7buw/17/

Fixes #9546
Copy link
Member

Choose a reason for hiding this comment

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

if ( events && events.remove ) {

@scottgonzalez
Copy link
Member

Thanks. I'll fix the style issues when I merge this.

@scottgonzalez
Copy link
Member

You signed the CLA with a different email address than you have in your git config. Which email address do you want to use?

Copy link
Member

Choose a reason for hiding this comment

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

Multiple var statements aren't allowed, and variables should never be declared inside a loop.

@scottgonzalez
Copy link
Member

In the future, please make sure to run the tests.

@felvhage
Copy link
Contributor Author

Sorry about the style-errors. I will have have a look at grunt/jshint....
Thank you for your efforts.
Preffered email: ...@googlemail.com

@felvhage
Copy link
Contributor Author

I'll give it another try.

@scottgonzalez
Copy link
Member

I'll give it another try.

Don't worry about it. I've got it all fixed locally, about to merge...

@felvhage
Copy link
Contributor Author

Ok 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants