diff options
author | Juan José Arboleda <soyjuanarbol@gmail.com> | 2020-04-13 18:42:13 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2020-04-28 14:15:03 +0300 |
commit | c1f54c7313b1adc77b49e95449300dd257a96484 (patch) | |
tree | e1e39cc2799fde0a0ed38d941b5fb9c1a30d90e8 /src/node_os.cc | |
parent | 0b2cff28b940667d66ab9e81c0a5c8a03cfea374 (diff) |
src: remove validation of unreachable code
Based on https://github.com/nodejs/help/issues/2600#issuecomment-612857153
the condition (amount < 0) won't be possible.
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src/node_os.cc')
-rw-r--r-- | src/node_os.cc | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/node_os.cc b/src/node_os.cc index f84c0f216e3..8a603351b92 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -134,16 +134,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); } |