diff options
| author | Igor Minar | 2013-02-08 03:55:34 -0800 |
|---|---|---|
| committer | Igor Minar | 2013-02-11 14:07:57 -0800 |
| commit | 43fccf56172eae640bb7601f297c23cd81a7afaf (patch) | |
| tree | c21867a2c673359e73cf02952fef6a3d32f54caa /src | |
| parent | a5b3bcf41cb0e3130439666a78a0ba9feadbd84a (diff) | |
| download | angular.js-43fccf56172eae640bb7601f297c23cd81a7afaf.tar.bz2 | |
refactor(angular.copy): use array.length=0 to empty arrays
Diffstat (limited to 'src')
| -rw-r--r-- | src/Angular.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Angular.js b/src/Angular.js index d983fd19..0548f14b 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -567,9 +567,7 @@ function copy(source, destination){ } else { if (source === destination) throw Error("Can't copy equivalent objects or arrays"); if (isArray(source)) { - while(destination.length) { - destination.pop(); - } + destination.length = 0; for ( var i = 0; i < source.length; i++) { destination.push(copy(source[i])); } |
