Browse Source

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: https://github.com/nodejs/node/pull/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>
canary-base
Anna Henningsen 7 years ago
parent
commit
6a0e3b16f3
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 2
      src/node_url.cc

2
src/node_url.cc

@ -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++)

Loading…
Cancel
Save