Skip to content

Commit 1dfa1a2

Browse files
koh110gireeshpunathil
authored andcommittedNov 29, 2018
src: replace create new Array
PR-URL: nodejs#24618 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Masashi Hirano <[email protected]>
1 parent 32b0958 commit 1dfa1a2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/node_serdes.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,11 @@ void DeserializerContext::ReadUint64(const FunctionCallbackInfo<Value>& args) {
399399
Isolate* isolate = ctx->env()->isolate();
400400
Local<Context> context = ctx->env()->context();
401401

402-
Local<Array> ret = Array::New(isolate, 2);
403-
ret->Set(context, 0, Integer::NewFromUnsigned(isolate, hi)).FromJust();
404-
ret->Set(context, 1, Integer::NewFromUnsigned(isolate, lo)).FromJust();
405-
return args.GetReturnValue().Set(ret);
402+
Local<Value> ret[] = {
403+
Integer::NewFromUnsigned(isolate, hi),
404+
Integer::NewFromUnsigned(isolate, lo)
405+
};
406+
return args.GetReturnValue().Set(Array::New(isolate, ret, arraysize(ret)));
406407
}
407408

408409
void DeserializerContext::ReadDouble(const FunctionCallbackInfo<Value>& args) {

0 commit comments

Comments
 (0)
Please sign in to comment.