Skip to content

Commit

Permalink
Merged fschaefer's loop speedups.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Aug 9, 2011
2 parents deb6d8d + a44ddae commit 84ff582
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions es5-shim.js
Expand Up @@ -369,10 +369,10 @@ if (!Array.prototype.reduceRight) {
} while (true); } while (true);
} }


for (; i >= 0; i--) { do {
if (i in self) if (i in this)
result = fun.call(null, result, self[i], i, self); result = fun.call(null, result, self[i], i, self);
} } while (i--);


return result; return result;
}; };
Expand Down

6 comments on commit 84ff582

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's cleaner at least. The various loop speeds change from engine to engine and browser version to version.

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kitcambridge U serious? I don't even...

@kriskowal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone here has strong enough feelings about this issue to submit a patch, I’ll accept it. I certainly don’t care enough to do it myself.

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kriskowal It's Friday fun day!

@kriskowal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is damn funny. In my first job, I targetted Navigator 4.7 and IE 5 and it made IE 6 look like a breath of fresh air.

@jdalton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IE 5 makes me cry. It has BORKED Array#push (among other Array probs)!

Please sign in to comment.