Skip to content

Commit

Permalink
More efficient iteration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Oct 19, 2015
1 parent ebeaf80 commit 23a9a06
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/standard/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@
// storage for configuration
_setupConfigure: function(initialConfig) {
this._config = {};
// don't accept undefined values in intialConfig
for (var i in initialConfig) {
if (initialConfig[i] !== undefined) {
this._config[i] = initialConfig[i];
this._handlers = [];
if (initialConfig) {
// don't accept undefined values in intialConfig
for (var i in initialConfig) {
if (initialConfig[i] !== undefined) {
this._config[i] = initialConfig[i];
}
}
}
this._handlers = [];
},

// static attributes are deserialized into _config
Expand Down Expand Up @@ -87,9 +89,9 @@
// get individual default values from property configs
var config = {};
// mixed-in behaviors
this.behaviors.forEach(function(b) {
this._configureProperties(b.properties, config);
}, this);
for (var i=0; i < this.behaviors.length; i++) {
this._configureProperties(this.behaviors[i].properties, config);
}
// prototypical behavior
this._configureProperties(this.properties, config);
// override local configuration with configuration from above
Expand Down

0 comments on commit 23a9a06

Please sign in to comment.