Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b24e381

Browse files
committed
style(shallowCopy): use common for loop style
1 parent e3f26b5 commit b24e381

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Angular.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -830,19 +830,16 @@ function copy(source, destination, stackSource, stackDest) {
830830
* Assumes that there no proto properties for objects
831831
*/
832832
function shallowCopy(src, dst) {
833-
var i = 0;
834-
var l, key;
835-
836833
if (isArray(src)) {
837834
dst = dst || [];
838835

839-
for (l = src.length; i < l; i++) {
836+
for (var i = 0, ii = src.length; i < ii; i++) {
840837
dst[i] = src[i];
841838
}
842839
} else if (isObject(src)) {
843840
dst = dst || {};
844841

845-
for (key in src) {
842+
for (var key in src) {
846843
if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
847844
dst[key] = src[key];
848845
}

0 commit comments

Comments
 (0)