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 4d748ad

Browse filesBrowse files
addaleaxaduh95
authored andcommitted
src: remove std::array overload of FIXED_ONE_BYTE_STRING
This overload was only used in one place, in a cold path, and in particular in a place where the compiler would be able to generate the exact same code using just a call to `.size()`. PR-URL: #59826 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 4cc84c9 commit 4d748ad
Copy full SHA for 4d748ad

File tree

Expand file treeCollapse file tree

2 files changed

+1
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+1
-9
lines changed
Open diff view settings
Collapse file

‎src/node_os.cc‎

Copy file name to clipboardExpand all lines: src/node_os.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
260260
result.emplace_back(OneByteString(isolate, ip));
261261
result.emplace_back(OneByteString(isolate, netmask));
262262
result.emplace_back(family);
263-
result.emplace_back(FIXED_ONE_BYTE_STRING(isolate, mac));
263+
result.emplace_back(OneByteString(isolate, mac.data(), mac.size() - 1));
264264
result.emplace_back(
265265
Boolean::New(env->isolate(), interfaces[i].is_internal));
266266
if (interfaces[i].address.address4.sin_family == AF_INET6) {
Collapse file

‎src/util.h‎

Copy file name to clipboardExpand all lines: src/util.h
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,6 @@ inline v8::Local<v8::String> FIXED_ONE_BYTE_STRING(v8::Isolate* isolate,
355355
return OneByteString(isolate, data, N - 1);
356356
}
357357

358-
template <std::size_t N>
359-
requires(N > 0)
360-
inline v8::Local<v8::String> FIXED_ONE_BYTE_STRING(
361-
v8::Isolate* isolate, const std::array<char, N>& arr) {
362-
CHECK_EQ(arr[N - 1], '\0');
363-
return OneByteString(isolate, arr.data(), N - 1);
364-
}
365-
366358
// tolower() is locale-sensitive. Use ToLower() instead.
367359
inline char ToLower(char c);
368360
inline std::string ToLower(const std::string& in);

0 commit comments

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