Skip to content

Commit 9435fbf

Browse files
tniessendanielleadams
authored andcommitted
src: remove dead code in base64_encode
If mode == Base64Mode::NORMAL, then the function has already returned. Refs: #39775 PR-URL: #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>
1 parent bfe0ac6 commit 9435fbf

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/base64-inl.h

-6
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,13 @@ inline size_t base64_encode(const char* src,
169169
a = src[i + 0] & 0xff;
170170
dst[k + 0] = table[a >> 2];
171171
dst[k + 1] = table[(a & 3) << 4];
172-
if (mode == Base64Mode::NORMAL) {
173-
dst[k + 2] = '=';
174-
dst[k + 3] = '=';
175-
}
176172
break;
177173
case 2:
178174
a = src[i + 0] & 0xff;
179175
b = src[i + 1] & 0xff;
180176
dst[k + 0] = table[a >> 2];
181177
dst[k + 1] = table[((a & 3) << 4) | (b >> 4)];
182178
dst[k + 2] = table[(b & 0x0f) << 2];
183-
if (mode == Base64Mode::NORMAL)
184-
dst[k + 3] = '=';
185179
break;
186180
}
187181

0 commit comments

Comments
 (0)