From e6965f048b6c99ab1e1bc61e5b65d65731e568e3 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 18 Aug 2017 04:34:05 +0200 Subject: [PATCH] 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(-) diff --git a/src/node_url.cc b/src/node_url.cc index 01e46eb7643e53..dd3da1133ebf2a 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++)