mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
src: use validate_ascii_with_errors instead of validate_ascii
It has better performance PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
6f93c4b287
commit
79fb8cbcf5
1 file changed
+2
-1
+2
-1
@@ -1252,7 +1252,8 @@ static void IsAscii(const FunctionCallbackInfo<Value>& 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<Value>& args) {
|
||||
|
||||
Reference in new issue
Block a user