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 <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
  • 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
Original file line number Diff line number Diff line change
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.