diff options
| author | sunnylost | 2013-10-14 15:03:11 +0800 | 
|---|---|---|
| committer | Pete Bacon Darwin | 2013-11-26 06:45:47 +0000 | 
| commit | c2e45c769ef7a45f2bd14870236fd8e8bed38246 (patch) | |
| tree | a1aac4e3a538fdde3837d553961b64a31fcbc75c | |
| parent | b08427dde9307bb442e3632f24d7b7054a50350e (diff) | |
| download | angular.js-c2e45c769ef7a45f2bd14870236fd8e8bed38246.tar.bz2 | |
refactor(angular.js): improve trim performance
According to Flagrant Badassery's blog
http://blog.stevenlevithan.com/archives/faster-trim-javascript
and this comparison http://jsperf.com/trim-function, this trim method is faster.
Closes #4406
| -rw-r--r-- | src/Angular.js | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/src/Angular.js b/src/Angular.js index 11222118..f4f83d55 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -544,7 +544,7 @@ var trim = (function() {    // TODO: we should move this into IE/ES5 polyfill    if (!String.prototype.trim) {      return function(value) { -      return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value; +      return isString(value) ? value.replace(/^\s\s*/, '').replace(/\s\s*$/, '') : value;      };    }    return function(value) { | 
