Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f2c08c7

Browse filesBrowse files
ChALkeRaduh95
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 ea87eea commit f2c08c7
Copy full SHA for f2c08c7

1 file changed

+2-1Lines changed: 2 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_buffer.cc‎

Copy file name to clipboardExpand all lines: src/node_buffer.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,8 @@ static void IsAscii(const FunctionCallbackInfo<Value>& args) {
12521252
env, "Cannot validate on a detached buffer");
12531253
}
12541254

1255-
args.GetReturnValue().Set(simdutf::validate_ascii(abv.data(), abv.length()));
1255+
args.GetReturnValue().Set(
1256+
!simdutf::validate_ascii_with_errors(abv.data(), abv.length()).error);
12561257
}
12571258

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.