Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

refactor(angular.js): improve trim performance #4406

Closed
wants to merge 1 commit into from

Conversation

sunnylost
Copy link
Contributor

According to Flagrant Badassery's blog http://blog.stevenlevithan.com/archives/faster-trim-javascript and this comparision http://jsperf.com/trim-function, this trim method is faster.

@mary-poppins
Copy link

Thanks for the PR!

  • Contributor signed CLA now or in the past
    • If you just signed, leave a comment here with your real name
  • PR's commit messages follow the commit message format

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@petebacondarwin
Copy link
Contributor

LGTM. @sunnylost - can you please ensure that you have signed the CLA. Also the commit message should be:

refactor(angular.js): improve trim performance

According to Flagrant Badassery's blog
http://blog.stevenlevithan.com/archives/faster-trim-javascript
and this comparision http://jsperf.com/trim-function, this trim method is faster.

Closes #4406

@sunnylost
Copy link
Contributor Author

Sorry, I didn't know this, I've just signed the CLA and edited the commit message.

@btford
Copy link
Contributor

btford commented Oct 14, 2013

@petebacondarwin it might also be good to link to the jsperf and article about the optimization from a code comment.

@petebacondarwin
Copy link
Contributor

@btford - Isn't this what git blame is for?

@btford
Copy link
Contributor

btford commented Oct 14, 2013

This makes it more accessible for those who don't know how to use git blame (this probably amounts to 99% of people on GH). And AFAIK, there's not a great way to see those annotations on GH.

@petebacondarwin
Copy link
Contributor

Its not great(!) but there is a "blame" button when viewing a file, which leads to a view like this: https://github.com/angular/angular.js/blame/master/src/Angular.js

The only reason I questioned this is that Vojta recently suggested I removed a similar code comment on the grounds that it would be in the commit: https://github.com/angular/angular.js/pull/3331/files#/r6801256

jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants