1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

optimizing comprehensions source references

This commit is contained in:
Jeremy Ashkenas 2010-10-06 21:13:11 -04:00
parent 5605ba32e3
commit d4dac214ab
11 changed files with 70 additions and 86 deletions

View file

@ -1,4 +1,4 @@
var _i, _j, _len, _len2, _ref, _ref2, _result, food, lunch, roid, roid2;
var _i, _j, _len, _len2, _len3, _ref, _result, food, index, lunch, roid, roid2;
lunch = (function() {
_result = []; _ref = ['toast', 'cheese', 'wine'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@ -7,12 +7,10 @@ lunch = (function() {
}
return _result;
})();
_ref = asteroids;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
roid = _ref[_i];
_ref2 = asteroids;
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
roid2 = _ref2[_j];
for (index = 0, _len2 = asteroids.length; index < _len2; index++) {
roid = asteroids[index];
for (_j = 0, _len3 = asteroids.length; _j < _len3; _j++) {
roid2 = asteroids[_j];
if (roid !== roid2) {
if (roid.overlaps(roid2)) {
roid.explode();