Skip to content

Commit 28a1cc1

Browse files
cjihrigBethGriggs
authored andcommitted
src: simplify uptime and ppid return values
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]>
1 parent ccefef2 commit 28a1cc1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/node_process.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ using v8::Integer;
5454
using v8::Isolate;
5555
using v8::Local;
5656
using v8::Name;
57-
using v8::Number;
5857
using v8::PropertyCallbackInfo;
5958
using v8::String;
6059
using v8::Uint32;
@@ -268,7 +267,7 @@ void Uptime(const FunctionCallbackInfo<Value>& args) {
268267
uv_update_time(env->event_loop());
269268
uptime = uv_now(env->event_loop()) - prog_start_time;
270269

271-
args.GetReturnValue().Set(Number::New(env->isolate(), uptime / 1000));
270+
args.GetReturnValue().Set(uptime / 1000);
272271
}
273272

274273

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

794793
void GetParentProcessId(Local<Name> property,
795794
const PropertyCallbackInfo<Value>& info) {
796-
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), uv_os_getppid()));
795+
info.GetReturnValue().Set(uv_os_getppid());
797796
}
798797

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

0 commit comments

Comments
 (0)