aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorMisko Hevery2010-05-30 20:21:40 -0700
committerMisko Hevery2010-05-30 20:21:40 -0700
commit81dac70e72430b7ab9a824ab923038c1e00e7003 (patch)
tree17efcdc2df48d32a0a928cc2ab755f355e9f6ae1 /src/Angular.js
parent2e33e89a77d115ff17f5841ec328b1c1e4228161 (diff)
downloadangular.js-81dac70e72430b7ab9a824ab923038c1e00e7003.tar.bz2
imrove $orderBy performance
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 39e9b385..2b26c88d 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -244,18 +244,17 @@ function copy(source, destination){
while(destination.length) {
destination.pop();
}
+ for ( var i = 0; i < source.length; i++) {
+ destination.push(copy(source[i]));
+ }
} else {
foreach(destination, function(value, key){
delete destination[key];
});
+ for ( var key in source) {
+ destination[key] = copy(source[key]);
+ }
}
- foreach(source, function(value, key){
- destination[key] = value ?
- ( isArray(value) ?
- copy(value, []) :
- (isObject(value) ? copy(value, {}) : value)) :
- value;
- });
return destination;
}
}