Permalink
Browse files

optimize preComputing, by removing 2+n checks and one anonymous function

  • Loading branch information...
1 parent 8ad626e commit b8e087058d845b343e344900ddfd58365371aa48 @RStankov RStankov committed Feb 17, 2010
Showing with 5 additions and 9 deletions.
  1. +5 −9 src/dom/layout.js
View
@@ -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);
}
},

0 comments on commit b8e0870

Please sign in to comment.