diff options
author | Juan José Arboleda <soyjuanarbol@gmail.com> | 2020-04-13 18:42:13 +0300 |
---|---|---|
committer | Juan José Arboleda <soyjuanarbol@gmail.com> | 2020-04-19 17:24:09 +0300 |
commit | 250060a0509204031ae068a5aa90e3481c1a78ae (patch) | |
tree | 80d8b12a9277401d17816e7d3f01cf2c29e93ba8 /src/node_os.cc | |
parent | a6a15fefb6aea781d3e08f44633cd137ca2c844f (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 b64b75fa6b9..8f1ca4f0c3f 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -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); } |