Shortcut strncmp in string to number conversion path (513434, r=sayrer).

This commit is contained in:
Andreas Gal 2009-08-29 02:28:00 -07:00
parent 3ffdadab9b
commit 7a4da2ecd3

View File

@ -1174,7 +1174,7 @@ js_strtod(JSContext *cx, const jschar *s, const jschar *send,
istr = cstr;
if ((negative = (*istr == '-')) != 0 || *istr == '+')
istr++;
if (!strncmp(istr, js_Infinity_str, sizeof js_Infinity_str - 1)) {
if (*istr == 'I' && !strncmp(istr, js_Infinity_str, sizeof js_Infinity_str - 1)) {
d = *(negative ? cx->runtime->jsNegativeInfinity : cx->runtime->jsPositiveInfinity);
estr = istr + 8;
} else {