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>
This commit is contained in:
Anna Henningsen 2017-08-18 04:34:05 +02:00
parent 8850fd4da1
commit 6a0e3b16f3
No known key found for this signature in database
GPG Key ID: D8B9F5AEAE84E4CF

View File

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