Skip to content

Commit

Permalink
src: remove validation of unreachable code
Browse files Browse the repository at this point in the history
Based on nodejs/help#2600 (comment)
the condition (amount < 0) won't be possible.

PR-URL: #32818
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
  • Loading branch information
juanarbol authored and targos committed Apr 30, 2020
1 parent 9c18838 commit 0745f88
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/node_os.cc
Expand Up @@ -137,16 +137,12 @@ static void GetCPUInfo(const FunctionCallbackInfo<Value>& args) {

static void GetFreeMemory(const FunctionCallbackInfo<Value>& args) {
double amount = uv_get_free_memory();
if (amount < 0)
return;
args.GetReturnValue().Set(amount);
}


static void GetTotalMemory(const FunctionCallbackInfo<Value>& args) {
double amount = uv_get_total_memory();
if (amount < 0)
return;
args.GetReturnValue().Set(amount);
}

Expand Down

0 comments on commit 0745f88

Please sign in to comment.