Skip to content

Commit

Permalink
optimize preComputing, by removing 2+n checks and one anonymous function
Browse files Browse the repository at this point in the history
  • Loading branch information
RStankov committed Feb 17, 2010
1 parent 8ad626e commit b8e0870
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/dom/layout.js
Expand Up @@ -219,17 +219,13 @@
if (preCompute) {
this._preComputing = true;
this._begin();
}
Element.Layout.PROPERTIES.each( function(property) {
if (preCompute) {
this._compute(property);
} else {
this._set(property, null);
}
}, this);
if (preCompute) {
Element.Layout.PROPERTIES.each( this._compute, this );
this._end();
this._preComputing = false;
} else {
Element.Layout.PROPERTIES.each( function(property) {
this._set(property, null);
}, this);
}
},

Expand Down

0 comments on commit b8e0870

Please sign in to comment.