Skip to content

Commit

Permalink
Use a less-clever for-loop to reset temporary context variables.
Browse files Browse the repository at this point in the history
This style also saves six gzip'd bytes.
  • Loading branch information
benjamn committed Oct 24, 2013
1 parent 8e3c0a5 commit 68f96c3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions runtime/dev.js
Expand Up @@ -125,12 +125,10 @@

// Pre-initialize at least 20 temporary variables to enable hidden
// class optimizations for simple generators.
var tempIndex = 0;
var tempName;
while ((tempName = "t" + tempIndex) &&
(tempIndex < 20 || hasOwn.call(this, tempName))) {
for (var tempIndex = 0, tempName;
hasOwn.call(this, tempName = "t" + tempIndex) || tempIndex < 20;
++tempIndex) {
this[tempName] = null;
++tempIndex;
}
},

Expand Down

0 comments on commit 68f96c3

Please sign in to comment.