src: improve StringBytes::Encode perf on UTF8

Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day>
PR-URL: https://github.com/nodejs/node/pull/61131
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Nikita SkovorodaandGürgün Dayıoğlu authored and Antoine du Hamel committed 2026-01-27 22:52:32 +01:00
1 parent 99c29eb261
commit ceaa200d16
2 files changed
+21

No files matched your search

+2
View File
@@ -186,6 +186,8 @@ void BindingData::DecodeUTF8(const FunctionCallbackInfo<Value>& args) {
return node::THROW_ERR_ENCODING_INVALID_ENCODED_DATA(
env->isolate(), "The encoded data was not valid for encoding utf-8");
}
// TODO(chalker): save on utf8 validity recheck in StringBytes::Encode()
}
if (length == 0) return args.GetReturnValue().SetEmptyString();