Replace function expression with for loop
isCustomAttribute used an anonymous function in place of a for loop. Swap it out so we're not allocating unnecessarily.
Josh Duck committed
Mar 18, 2014 at 14:54 UTC
0278f01d9511ba9000f4bf5d112b01ff1446b3a8
1 file changed
+6
-4
src/browser/ui/dom/DOMProperty.js
+6
-4
@@ -231,11 +231,13 @@ var DOMProperty = {
231
* @method
232
*/
233
isCustomAttribute: function(attributeName) {
234
- return DOMProperty._isCustomAttributeFunctions.some(
235
- function(isCustomAttributeFn) {
236
- return isCustomAttributeFn.call(null, attributeName);
234
+ for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
235
+ var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
236
+ if (isCustomAttributeFn(attributeName)) {
237
+ return true;
238
}
238
- );
239
+ }
240
+ return false;
241
},
242
243
/**