Skip to content

Commit 4570fa1

Browse files
addaleaxMylesBorins
authored andcommitted
src: remove extra copy from Copy() in node_url.cc
The was copying the whole array and the strings in it without any benefit. PR-URL: #14907 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 8f3537f commit 4570fa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_url.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ static inline void Copy(Environment* env,
10071007
}
10081008

10091009
static inline Local<Array> Copy(Environment* env,
1010-
std::vector<std::string> vec) {
1010+
const std::vector<std::string>& vec) {
10111011
Isolate* isolate = env->isolate();
10121012
Local<Array> ary = Array::New(isolate, vec.size());
10131013
for (size_t n = 0; n < vec.size(); n++)

0 commit comments

Comments
 (0)