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 BethGriggs committed Apr 27, 2020
1 parent 03d02d7 commit f9b8988
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 @@ -132,16 +132,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 f9b8988

Please sign in to comment.