Closed Bug 1659923 Opened 4 years ago Closed 4 years ago

Avoid unnecessary copies around Base64Encode

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: sg, Assigned: sg)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Around the uses of Base64Encode, several unnecessary copies are made, e.g. the encoding is first made to a 8-bit string and then converted to a 16-bit string, while this can be done in one step. Or the result is first stored in a temporary string and then appended to the final string, where Base64EncodeAppend could better be used to avoid the allocation of a temporary string and copying it.

This also adds some more variants of Base64Encode and Base64EncodeAppend.

Depends on D87461

Blocks: 1660004
Blocks: 1660007
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/476067c405f4
Avoid unnecessary copies around Base64Encode. r=xpcom-reviewers,necko-reviewers,froydnj,valentin
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: