From e78cdd1a1cbb1cd11cb782ff423bcede1a1c9137 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 cc418017f76803..138fa14a96eda4 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -1230,7 +1230,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) {