summaryrefslogtreecommitdiff
path: root/src/node_url.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-08-18 04:34:05 +0200
committerAnna Henningsen <anna@addaleax.net>2017-08-21 16:54:38 +0200
commit6a0e3b16f3f8f74635baa6e6020d7cade7fee995 (patch)
treec0bf02df3ac4fe8012bb9c268b217a070e305d8d /src/node_url.cc
parent8850fd4da16d1477c699484de0c9eaeee31e6fa6 (diff)
downloadandroid-node-v8-6a0e3b16f3f8f74635baa6e6020d7cade7fee995.tar.gz
android-node-v8-6a0e3b16f3f8f74635baa6e6020d7cade7fee995.tar.bz2
android-node-v8-6a0e3b16f3f8f74635baa6e6020d7cade7fee995.zip
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>
Diffstat (limited to 'src/node_url.cc')
-rw-r--r--src/node_url.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_url.cc b/src/node_url.cc
index 01e46eb764..dd3da1133e 100644
--- a/src/node_url.cc
+++ b/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++)