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.
  • Loading branch information
juanarbol committed Apr 13, 2020
1 parent a46345d commit 43e857c
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 43e857c

Please sign in to comment.