mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use String.charAt for character by index lookup
Using object property accessor for string character lookup breaks in non-modern browsers.
This commit is contained in:
@@ -63,7 +63,7 @@ var findComponentRootReusableArray = [];
|
||||
function firstDifferenceIndex(string1, string2) {
|
||||
var minLen = Math.min(string1.length, string2.length);
|
||||
for (var i = 0; i < minLen; i++) {
|
||||
if (string1[i] !== string2[i]) {
|
||||
if (string1.charAt(i) !== string2.charAt(i)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user