From c98dbc641e0973e8db4f701c18d3254f40a02e7b Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Sun, 7 Apr 2024 13:56:55 -0700 Subject: Remove logically dead code Stage::T is never set, so it can never happen. Remove it entirely. Found using static analysis. Tested: Unit tests pass, good coverage here Change-Id: I0dfb1aad5bef3ab4451df5e81794e56074f6e939 Signed-off-by: Ed Tanous --- redfish-core/include/utils/time_utils.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'redfish-core') diff --git a/redfish-core/include/utils/time_utils.hpp b/redfish-core/include/utils/time_utils.hpp index 30011e3d9b..1708998798 100644 --- a/redfish-core/include/utils/time_utils.hpp +++ b/redfish-core/include/utils/time_utils.hpp @@ -53,7 +53,6 @@ inline std::optional // P1DT1H1M1.100S P, Days, - T, Hours, Minutes, Seconds, @@ -74,14 +73,10 @@ inline std::optional stage = ProcessingStage::Days; continue; } - if (stage == ProcessingStage::Days || stage == ProcessingStage::T) + if (stage == ProcessingStage::Days) { if (v.front() == 'T') { - if (stage == ProcessingStage::T) - { - return std::nullopt; - } v.remove_prefix(1); stage = ProcessingStage::Hours; continue; -- cgit v1.2.3