mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
src: use Utf8Value and TwoByteValue instead of V8 helpers
Our own helper classes have the advantage of using stack storage a lot of the time, so they should always be preferred. PR-URL: https://github.com/nodejs/node/pull/60244 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
This commit is contained in:
1 parent
336b2d08e1
commit
39447be4e4
12 files changed
+72
-61
No files matched your search
+6
-6
@@ -304,10 +304,10 @@ size_t StringBytes::Write(Isolate* isolate,
|
||||
input_view.length());
|
||||
}
|
||||
} else {
|
||||
String::Value value(isolate, str);
|
||||
TwoByteValue value(isolate, str);
|
||||
size_t written_len = buflen;
|
||||
auto result = simdutf::base64_to_binary_safe(
|
||||
reinterpret_cast<const char16_t*>(*value),
|
||||
reinterpret_cast<const char16_t*>(value.out()),
|
||||
value.length(),
|
||||
buf,
|
||||
written_len,
|
||||
@@ -343,10 +343,10 @@ size_t StringBytes::Write(Isolate* isolate,
|
||||
input_view.length());
|
||||
}
|
||||
} else {
|
||||
String::Value value(isolate, str);
|
||||
TwoByteValue value(isolate, str);
|
||||
size_t written_len = buflen;
|
||||
auto result = simdutf::base64_to_binary_safe(
|
||||
reinterpret_cast<const char16_t*>(*value),
|
||||
reinterpret_cast<const char16_t*>(value.out()),
|
||||
value.length(),
|
||||
buf,
|
||||
written_len);
|
||||
@@ -368,8 +368,8 @@ size_t StringBytes::Write(Isolate* isolate,
|
||||
reinterpret_cast<const char*>(input_view.data8()),
|
||||
input_view.length());
|
||||
} else {
|
||||
String::Value value(isolate, str);
|
||||
nbytes = nbytes::HexDecode(buf, buflen, *value, value.length());
|
||||
TwoByteValue value(isolate, str);
|
||||
nbytes = nbytes::HexDecode(buf, buflen, value.out(), value.length());
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in new issue
Block a user