From 6a0e3b16f3f8f74635baa6e6020d7cade7fee995 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 18 Aug 2017 04:34:05 +0200 Subject: src: remove extra copy from Copy() in node_url.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Tobias Nießen Reviewed-By: Timothy Gu Reviewed-By: Colin Ihrig --- src/node_url.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/node_url.cc') 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 Copy(Environment* env, - std::vector vec) { + const std::vector& vec) { Isolate* isolate = env->isolate(); Local ary = Array::New(isolate, vec.size()); for (size_t n = 0; n < vec.size(); n++) -- cgit v1.2.3