From f9b8988df6cd5527aa13a93fe05e443f57b7d78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Mon, 13 Apr 2020 10:42:13 -0500 Subject: [PATCH] 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 Reviewed-By: Yongsheng Zhang Reviewed-By: Zeyu Yang Reviewed-By: Shelley Vohr Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Gus Caplan --- src/node_os.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/node_os.cc b/src/node_os.cc index b64b75fa6b90be..8f1ca4f0c3ff77 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -132,16 +132,12 @@ static void GetCPUInfo(const FunctionCallbackInfo& args) { static void GetFreeMemory(const FunctionCallbackInfo& args) { double amount = uv_get_free_memory(); - if (amount < 0) - return; args.GetReturnValue().Set(amount); } static void GetTotalMemory(const FunctionCallbackInfo& args) { double amount = uv_get_total_memory(); - if (amount < 0) - return; args.GetReturnValue().Set(amount); }