aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIgor Minar2013-02-08 03:55:34 -0800
committerIgor Minar2013-02-11 14:07:57 -0800
commit43fccf56172eae640bb7601f297c23cd81a7afaf (patch)
treec21867a2c673359e73cf02952fef6a3d32f54caa /src
parenta5b3bcf41cb0e3130439666a78a0ba9feadbd84a (diff)
downloadangular.js-43fccf56172eae640bb7601f297c23cd81a7afaf.tar.bz2
refactor(angular.copy): use array.length=0 to empty arrays
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js4
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]));
}