From f11c0ab29e4b6f2ef96a71a277aed0519f021070 Mon Sep 17 00:00:00 2001 From: Nikita Skovoroda Date: Fri, 19 Dec 2025 13:33:11 +0400 Subject: [PATCH] src: use validate_ascii_with_errors instead of validate_ascii It has better performance --- src/node_buffer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index d4a63cf610ca7f..e40a21288ee79d 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -1252,7 +1252,8 @@ static void IsAscii(const FunctionCallbackInfo& args) { env, "Cannot validate on a detached buffer"); } - args.GetReturnValue().Set(simdutf::validate_ascii(abv.data(), abv.length())); + args.GetReturnValue().Set( + !simdutf::validate_ascii_with_errors(abv.data(), abv.length()).error); } void SetBufferPrototype(const FunctionCallbackInfo& args) {