Skip to content

Commit

Permalink
src: simplify uptime and ppid return values
Browse files Browse the repository at this point in the history
This commit removes extraneous wrapping of return values
in Uptime() and GetParentProcessId().

PR-URL: #24562
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
  • Loading branch information
cjihrig authored and BethGriggs committed Feb 11, 2019
1 parent ccefef2 commit 28a1cc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/node_process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ using v8::Integer;
using v8::Isolate;
using v8::Local;
using v8::Name;
using v8::Number;
using v8::PropertyCallbackInfo;
using v8::String;
using v8::Uint32;
Expand Down Expand Up @@ -268,7 +267,7 @@ void Uptime(const FunctionCallbackInfo<Value>& args) {
uv_update_time(env->event_loop());
uptime = uv_now(env->event_loop()) - prog_start_time;

args.GetReturnValue().Set(Number::New(env->isolate(), uptime / 1000));
args.GetReturnValue().Set(uptime / 1000);
}


Expand Down Expand Up @@ -793,7 +792,7 @@ void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {

void GetParentProcessId(Local<Name> property,
const PropertyCallbackInfo<Value>& info) {
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), uv_os_getppid()));
info.GetReturnValue().Set(uv_os_getppid());
}

void GetActiveRequests(const FunctionCallbackInfo<Value>& args) {
Expand Down

0 comments on commit 28a1cc1

Please sign in to comment.