Closed Bug 1439362 Opened 3 years ago Closed 3 years ago
Base64Encoder slightly less malloc-happy
nsBase64Encoder::Finish currently works by calling PL_Base64Encode to allocate a base64-encoded string, then Assign()'ing that to the result string, another allocation. mozilla::Base64Encode enables us to base64 encode directly into the result string with a single allocation, saving an allocation. (Base64Encode is also slightly more efficient, because we don't have to do a strlen() on the string being Assign()'d.) Let's use Base64Encode instead.
A small improvement, but a nice one.
Attachment #8952122 - Flags: review?(valentin.gosu)
Attachment #8952122 - Flags: review?(valentin.gosu) → review+
Priority: -- → P2
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/43b8d13b9961 make nsBase64Encoder slightly less malloc-happy; r=valentin
You need to log in before you can comment on or make changes to this bug.