Cache length of NodeList when updating radios
Paul O'Shannessy committed
Sep 9, 2013 at 11:52 UTC
9d0f3623c3a13f77ef71ad4ad3ed50ce46f13785
1 file changed
+1
-1
src/dom/components/ReactDOMInput.js
+1
-1
@@ -129,7 +129,7 @@ var ReactDOMInput = ReactCompositeComponent.createClass({
129
// the input might not even be in a form, let's just use the global
130
// `getElementsByName` to ensure we don't miss anything.
131
var group = document.getElementsByName(name);
132
- for (var i = 0; i < group.length; i++) {
132
+ for (var i = 0, groupLen = group.length; i < groupLen; i++) {
133
var otherNode = group[i];
134
if (otherNode === rootNode ||
135
otherNode.nodeName !== 'INPUT' || otherNode.type !== 'radio' ||