Skip to content

Commit

Permalink
src: remove extra copy from Copy() in node_url.cc
Browse files Browse the repository at this point in the history
The was copying the whole array and the strings in it without
any benefit.

PR-URL: #14907
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
addaleax authored and MylesBorins committed Sep 12, 2017
1 parent 8f3537f commit 4570fa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ static inline void Copy(Environment* env,
}

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

0 comments on commit 4570fa1

Please sign in to comment.