From 30afb5b79783f2d3aacbc5a9aa08a972191158d0 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 --- 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) {