mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
src: remove dead code in base64_encode
If mode == Base64Mode::NORMAL, then the function has already returned. Refs: https://github.com/nodejs/node/pull/39775 PR-URL: https://github.com/nodejs/node/pull/43979 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Feng Yu <F3n67u@outlook.com>
This commit is contained in:
@@ -169,10 +169,6 @@ inline size_t base64_encode(const char* src,
|
||||
a = src[i + 0] & 0xff;
|
||||
dst[k + 0] = table[a >> 2];
|
||||
dst[k + 1] = table[(a & 3) << 4];
|
||||
if (mode == Base64Mode::NORMAL) {
|
||||
dst[k + 2] = '=';
|
||||
dst[k + 3] = '=';
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
a = src[i + 0] & 0xff;
|
||||
@@ -180,8 +176,6 @@ inline size_t base64_encode(const char* src,
|
||||
dst[k + 0] = table[a >> 2];
|
||||
dst[k + 1] = table[((a & 3) << 4) | (b >> 4)];
|
||||
dst[k + 2] = table[(b & 0x0f) << 2];
|
||||
if (mode == Base64Mode::NORMAL)
|
||||
dst[k + 3] = '=';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user