Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6628297

Browse files
XadillaXtargos
authored andcommittedJun 5, 2021
buffer: remove TODOs in atob / btoa
Refs: #38433 (comment) PR-URL: #38548 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent e0d7529 commit 6628297

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎lib/buffer.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,9 @@ const lazyInvalidCharError = hideStackFrames((message, name) => {
12121212
});
12131213

12141214
function btoa(input) {
1215-
// TODO(@jasnell): The implementation here has not been performance
1216-
// optimized in any way.
1215+
// The implementation here has not been performance optimized in any way and
1216+
// should not be.
1217+
// Refs: https://github.com/nodejs/node/pull/38433#issuecomment-828426932
12171218
input = `${input}`;
12181219
for (let n = 0; n < input.length; n++) {
12191220
if (input[n].charCodeAt(0) > 0xff)
@@ -1227,8 +1228,9 @@ const kBase64Digits =
12271228
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
12281229

12291230
function atob(input) {
1230-
// TODO(@jasnell): The implementation here has not been performance
1231-
// optimized in any way.
1231+
// The implementation here has not been performance optimized in any way and
1232+
// should not be.
1233+
// Refs: https://github.com/nodejs/node/pull/38433#issuecomment-828426932
12321234
input = `${input}`;
12331235
for (let n = 0; n < input.length; n++) {
12341236
if (!kBase64Digits.includes(input[n]))

0 commit comments

Comments
 (0)
Please sign in to comment.