Skip to content

Commit 4e23be1

Browse files
ChALkeRjuanarbol
authored andcommitted
src: use validate_ascii_with_errors instead of validate_ascii
It has better performance PR-URL: #61122 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 8806f79 commit 4e23be1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/node_buffer.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,8 @@ static void IsAscii(const FunctionCallbackInfo<Value>& args) {
12111211
env, "Cannot validate on a detached buffer");
12121212
}
12131213

1214-
args.GetReturnValue().Set(simdutf::validate_ascii(abv.data(), abv.length()));
1214+
args.GetReturnValue().Set(
1215+
!simdutf::validate_ascii_with_errors(abv.data(), abv.length()).error);
12151216
}
12161217

12171218
void SetBufferPrototype(const FunctionCallbackInfo<Value>& args) {

0 commit comments

Comments
 (0)