Check in balleysson@bigfoot.com's patch to avoid a redundant js_strlen (87271, r=shaver, sr=brendan).

This commit is contained in:
brendan%mozilla.org 2001-08-10 08:02:25 +00:00
parent 6abf5d1dd4
commit d109dc3d71

View File

@ -2308,7 +2308,7 @@ js_NewStringCopyZ(JSContext *cx, const jschar *s, uintN gcflag)
if (!news)
return NULL;
memcpy(news, s, m);
str = js_NewString(cx, news, js_strlen(news), gcflag);
str = js_NewString(cx, news, n, gcflag);
if (!str)
JS_free(cx, news);
return str;