Avoid a strlen call in NumberToStringWithBase for int32 values

RESOLVED FIXED in Firefox 62

Status

()

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: anba, Assigned: anba)

Tracking

Trunk
mozilla62
Points:
---

Firefox Tracking Flags

(firefox62 fixed)

Details

Attachments

(1 attachment)

No description provided.
Int32ToCString() already returns the string length, so we can reuse that info instead of calling strlen() again in NewStringCopyZ(). This also matches the approach taken in js::NumberValueToStringBuffer().

Also removes an out of date comment in js::NumberValueToStringBuffer.
Attachment #8982448 - Flags: review?(jdemooij)
Comment on attachment 8982448 [details] [diff] [review]
bug1466050.patch

Review of attachment 8982448 [details] [diff] [review]:
-----------------------------------------------------------------

Great :)
Attachment #8982448 - Flags: review?(jdemooij) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eacd6f23d1d6
Skip a call to strlen in Number.prototype.toString when length was already computed. r=jandem
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/eacd6f23d1d6
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.