Skip to content

Commit 9caad06

Browse files
cjihrigrvagg
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 <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jon Moss <me@jonathanmoss.me>
1 parent 3df8633 commit 9caad06

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;
@@ -259,7 +258,7 @@ void Uptime(const FunctionCallbackInfo<Value>& args) {
259258
uv_update_time(env->event_loop());
260259
uptime = uv_now(env->event_loop()) - prog_start_time;
261260

262-
args.GetReturnValue().Set(Number::New(env->isolate(), uptime / 1000));
261+
args.GetReturnValue().Set(uptime / 1000);
263262
}
264263

265264

@@ -790,7 +789,7 @@ void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
790789

791790
void GetParentProcessId(Local<Name> property,
792791
const PropertyCallbackInfo<Value>& info) {
793-
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), uv_os_getppid()));
792+
info.GetReturnValue().Set(uv_os_getppid());
794793
}
795794

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

0 commit comments

Comments
 (0)