Skip to content

Commit 23a9a06

Browse files
author
Steven Orvell
committed
More efficient iteration.
1 parent ebeaf80 commit 23a9a06

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎src/standard/configure.html‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@
4646
// storage for configuration
4747
_setupConfigure: function(initialConfig) {
4848
this._config = {};
49-
// don't accept undefined values in intialConfig
50-
for (var i in initialConfig) {
51-
if (initialConfig[i] !== undefined) {
52-
this._config[i] = initialConfig[i];
49+
this._handlers = [];
50+
if (initialConfig) {
51+
// don't accept undefined values in intialConfig
52+
for (var i in initialConfig) {
53+
if (initialConfig[i] !== undefined) {
54+
this._config[i] = initialConfig[i];
55+
}
5356
}
5457
}
55-
this._handlers = [];
5658
},
5759

5860
// static attributes are deserialized into _config
@@ -87,9 +89,9 @@
8789
// get individual default values from property configs
8890
var config = {};
8991
// mixed-in behaviors
90-
this.behaviors.forEach(function(b) {
91-
this._configureProperties(b.properties, config);
92-
}, this);
92+
for (var i=0; i < this.behaviors.length; i++) {
93+
this._configureProperties(this.behaviors[i].properties, config);
94+
}
9395
// prototypical behavior
9496
this._configureProperties(this.properties, config);
9597
// override local configuration with configuration from above

0 commit comments

Comments
 (0)