From 25fbd3825a6186ee01c69dea21cdb59ff0b61d0c Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sat, 15 Jun 2024 09:41:37 -0400 Subject: [PATCH] src: remove `SetEncoding` from StringEncoder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/53441 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Matteo Collina Reviewed-By: Daniel Lemire --- src/string_decoder-inl.h | 6 ------ src/string_decoder.h | 1 - 2 files changed, 7 deletions(-) diff --git a/src/string_decoder-inl.h b/src/string_decoder-inl.h index e7c0abb51546a7..5b18a27ec56f12 100644 --- a/src/string_decoder-inl.h +++ b/src/string_decoder-inl.h @@ -7,12 +7,6 @@ namespace node { -void StringDecoder::SetEncoding(enum encoding encoding) { - state_[kBufferedBytes] = 0; - state_[kMissingBytes] = 0; - state_[kEncodingField] = encoding; -} - enum encoding StringDecoder::Encoding() const { return static_cast(state_[kEncodingField]); } diff --git a/src/string_decoder.h b/src/string_decoder.h index 9059eeaa9d2eb7..ced3482ef2347f 100644 --- a/src/string_decoder.h +++ b/src/string_decoder.h @@ -10,7 +10,6 @@ namespace node { class StringDecoder { public: StringDecoder() { state_[kEncodingField] = BUFFER; } - inline void SetEncoding(enum encoding encoding); inline enum encoding Encoding() const; inline char* IncompleteCharacterBuffer();