From 9435fbf8cdb718702577136f4da430e8f3e6e57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 25 Jul 2022 16:01:14 +0200 Subject: [PATCH] src: remove dead code in base64_encode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Richard Lau Reviewed-By: Darshan Sen Reviewed-By: Feng Yu --- src/base64-inl.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/base64-inl.h b/src/base64-inl.h index d33cbde8687157..5546951df9b464 100644 --- a/src/base64-inl.h +++ b/src/base64-inl.h @@ -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; }