diff options
| author | Igor Minar | 2013-02-08 03:55:34 -0800 | 
|---|---|---|
| committer | Igor Minar | 2013-02-11 14:07:49 -0800 | 
| commit | 6b19e7d527dc67113e39bff0060238d78bed9447 (patch) | |
| tree | 6cd59918b488893581c46b0c531c365ee55a33e0 | |
| parent | 28273b7f1ef52e46d5bc23c41bc7a1492cf23014 (diff) | |
| download | angular.js-6b19e7d527dc67113e39bff0060238d78bed9447.tar.bz2 | |
refactor(angular.copy): use array.length=0 to empty arrays
| -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]));        } | 
