From b554ff762073175641db8c8af4e4e56447df65d4 Mon Sep 17 00:00:00 2001 From: kohta ito Date: Sat, 24 Nov 2018 17:02:10 +0900 Subject: [PATCH] src: replace create new Array PR-URL: https://github.com/nodejs/node/pull/24618 Reviewed-By: Anna Henningsen Reviewed-By: Shingo Inoue Reviewed-By: Gus Caplan Reviewed-By: Gireesh Punathil Reviewed-By: Masashi Hirano --- src/node_serdes.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 0a410944458d99..afeaebdeb29e1d 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -399,10 +399,11 @@ void DeserializerContext::ReadUint64(const FunctionCallbackInfo& args) { Isolate* isolate = ctx->env()->isolate(); Local context = ctx->env()->context(); - Local ret = Array::New(isolate, 2); - ret->Set(context, 0, Integer::NewFromUnsigned(isolate, hi)).FromJust(); - ret->Set(context, 1, Integer::NewFromUnsigned(isolate, lo)).FromJust(); - return args.GetReturnValue().Set(ret); + Local ret[] = { + Integer::NewFromUnsigned(isolate, hi), + Integer::NewFromUnsigned(isolate, lo) + }; + return args.GetReturnValue().Set(Array::New(isolate, ret, arraysize(ret))); } void DeserializerContext::ReadDouble(const FunctionCallbackInfo& args) {