From 6b19e7d527dc67113e39bff0060238d78bed9447 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 8 Feb 2013 03:55:34 -0800 Subject: refactor(angular.copy): use array.length=0 to empty arrays --- src/Angular.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Angular.js') 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])); } -- cgit v1.2.3