From b8a7eedea32df6f31704cb59f01c51c629bb958b Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 6 Aug 2013 17:42:28 +0200 Subject: [PATCH] process_wrap: omit superfluous Number creation Don't create a superfluous Number object, just use the version of v8::Object::Get() that takes an unsigned int. Convert the index to unsigned int while we're here. --- src/process_wrap.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 76376366e3..b3671d941a 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -86,13 +86,12 @@ class ProcessWrap : public HandleWrap { uv_process_options_t* options) { Local stdios = js_options ->Get(String::NewSymbol("stdio")).As(); - int len = stdios->Length(); + uint32_t len = stdios->Length(); options->stdio = new uv_stdio_container_t[len]; options->stdio_count = len; - for (int i = 0; i < len; i++) { - Local stdio = stdios - ->Get(Number::New(static_cast(i))).As(); + for (uint32_t i = 0; i < len; i++) { + Local stdio = stdios->Get(i).As(); Local type = stdio->Get(String::NewSymbol("type")); if (type->Equals(String::NewSymbol("ignore"))) {