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.
1.3 KiB
1.3 KiB